how to make an ability happen once every 2 or so tics after using

Maddshura

The gal who never finishes her maps
i have a speed increasing based lua script for my excalibur sonic, but i need it to happen only in short bursts
 
cool! how can i do it?
Hmmm maybe like:
<your boost code>
Player.timer = 15
Player.slow = true
End

If player.slow and player.timer
Player.timer = $ - 1
Player.mo.momx = $/2
Player.mo.momy = $/2
End
If not player.timer and player.slow
Player.slow = false
End
Post automatically merged:

It's not accurate because I'm not on phone
 
so would it work like this?
boost:
addHook("PlayerThink", function(player)
                if player.mo.skin == "windknight"
                if (player.cmd.buttons & (BT_CUSTOM1)) then
                P_Thrust(player.mo, player.mo.angle, 5*FRACUNIT)
                S_StartSound(player.mo, sfx_thok)
                end
                player.pflags = $|PF_THOKKED
                return true
                Player.timer = 15
                Player.slow = true
                end

                if player.slow and player.timer
                player.timer = $ - 1
                player.mo.momx = $/2
                player.mo.momy = $/2
                end
                if not player.timer and player.slow
                player.slow = false
                end
        end
end)
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top