-- Fly timer addHook("PlayerThink", function(player) local mo = player.mo -- less hassle mo.flytime = $ or 0 --Just in case, if $ exists then use $ (current number), else use 0 (will be a number but wont work with "if mo.hammertime") if mo.flytime mo.flytime = $-1 end if P_IsObjectOnGround(player.mo) == true mo.flytime = 280 end end) -- Floaters who can fly for a limited time addHook("PlayerThink", function(player) if player.mo.skin != "tails" return end -- Float if player.mo.state == S_PLAY_RUN and player.mo.flytime > 0 and P_IsObjectOnGround(player.mo) != true and (FixedDiv(player.mo.momz, player.mo.scale) <= 0) and not (player.mo.eflags & MFE_VERTICALFLIP) P_SetObjectMomZ(player.mo, 0, false) player.pflags = $|PF_CANCARRY end -- Float VERTIFLIP if player.mo.state == S_PLAY_RUN and player.mo.flytime > 0 and P_IsObjectOnGround(player.mo) != true and (FixedDiv(player.mo.momz, player.mo.scale) >= 0) and (player.mo.eflags & MFE_VERTICALFLIP) P_SetObjectMomZ(player.mo, 0, false) player.pflags = $|PF_CANCARRY end if player.mo.state == S_PLAY_RUN and player.mo.flytime > 0 and (leveltime % (TICRATE/3) == 0) S_StartSound(player.mo, sfx_putput) end if player.mo.state == S_PLAY_RUN and player.mo.flytime == 0 player.mo.state = S_PLAY_FLY_TIRED --S_StartSound(player.mo, sfx_pudpud) end end) -- For Super Floats addHook("PlayerThink", function(player) if player.mo.skin != "sonic" or "shadow" or "silver" or "s3sonic" or "adventuresonic" or "xsonic" or "blaze" or "marine" return end -- Float if player.mo.state == S_PLAY_RUN and player.powers[pw_super] and P_IsObjectOnGround(player.mo) != true and (FixedDiv(player.mo.momz, player.mo.scale) <= 0) and not (player.mo.eflags & MFE_VERTICALFLIP) P_SetObjectMomZ(player.mo, 0, false) end -- Float VERTIFLIP if player.mo.state == S_PLAY_RUN and player.powers[pw_super] and P_IsObjectOnGround(player.mo) != true and (FixedDiv(player.mo.momz, player.mo.scale) >= 0) and (player.mo.eflags & MFE_VERTICALFLIP) P_SetObjectMomZ(player.mo, 0, false) end end) -- Floating without Super no timer addHook("PlayerThink", function(player) if player.mo.skin != "metalsonic" return end -- Float if (player.mo.state == S_PLAY_RUN or player.mo.state == S_PLAY_DASH) and P_IsObjectOnGround(player.mo) != true and (FixedDiv(player.mo.momz, player.mo.scale) <= 0) and not (player.mo.eflags & MFE_VERTICALFLIP) P_SetObjectMomZ(player.mo, 0, false) end -- Float VERTIFLIP if (player.mo.state == S_PLAY_RUN or player.mo.state == S_PLAY_DASH) and player.powers[pw_super] and P_IsObjectOnGround(player.mo) != true and (FixedDiv(player.mo.momz, player.mo.scale) >= 0) and (player.mo.eflags & MFE_VERTICALFLIP) P_SetObjectMomZ(player.mo, 0, false) end end)