Rumia1
Backseat Developer
I have decided to make this thread for when I can't figure things out, probably because I did something stupid
First off I'm trying to edit the waiting animation's frame durations for a certain character, however it tells me that I'm trying to index a global variable "state" and I have no clue how to work fix that.
Here is my code:
Also please tell me if I'm going about this in the wrong way, I'm just starting LUA and I feel as though I either know exactly what I'm doing or I don't know at all and I can't figure out why
First off I'm trying to edit the waiting animation's frame durations for a certain character, however it tells me that I'm trying to index a global variable "state" and I have no clue how to work fix that.
Here is my code:
Code:
addHook("ThinkFrame", do
for player in players.iterate
if player.mo.skin == "sonic"
if player.mo.state == S_PLAY_TAP1
state.tics = 1
elseif player.mo.state == S_PLAY_TAP2
state.tics = 3
state.nextstate = S_PLAY_STAND
end
end
end
end)
Also please tell me if I'm going about this in the wrong way, I'm just starting LUA and I feel as though I either know exactly what I'm doing or I don't know at all and I can't figure out why
Last edited: