Simon_T
Pyro the Setsuna Fan
I'm trying to imitate the Vanilla Super Sonic's ability to float with Lua and custom states to allow him to uncurl and fly, but he gets stuck into a frame :'V
Here's the Lua
And the SOC for custom states
What I'm doing wrong?
Here's the Lua
Code:
addHook("ThinkFrame", do
for player in players.iterate
if (player.mo and player.mo.skin == "supersonic")
if player.cmd.buttons & BT_USE
and not P_IsObjectOnGround(player.mo)
player.mo.momz = 0
player.mo.state = S_PLAY_FLOAT1
end
end
end
end)
And the SOC for custom states
Code:
FREESLOT
S_PLAY_FLOAT1
S_PLAY_FLOAT2
STATE S_PLAY_FLOAT1
SPRITENAME = PLAY
SPRITEFRAME = U|FF_FULLBRIGHT
DURATION = 3
NEXT = S_PLAY_FLOAT2
STATE S_PLAY_FLOAT2
SPRITENAME = PLAY
SPRITEFRAME = V|FF_FULLBRIGHT
DURATION = 3
NEXT = S_PLAY_FLOAT1
What I'm doing wrong?
Last edited: