Please help i cant get this code working

thesrb2fan12

That one guy making frontiers sonic
this is supposed to be a drop dash for a character im working on but i cant get it working

Lua:
local function SwapAbilities(player)
if player.mo.skin ~= "fsonic" then
return
end

if (player.cmd.buttons & BT_CUSTOM2 & Charging == 0 & P_IsObjectOnGround(player.mo) == false)then
Charging = 1
player.mo.state = S_PLAY_SPINDASH
end

if (player.cmd.buttons & BT_CUSTOM2 & Charging == 1 & P_IsObjectOnGround(player.mo) == true) then
Charging = 0
P_InstaThrust(player.mo, player.mo.angle, player.actionspd)
player.mo.state = S_PLAY_ROLL
 player.pflags = $|PF_SPINNING
end

if not (player.cmd.buttons & BT_CUSTOM2)then
Charging = 0
player.mo.state = S_PLAY_ROLL
end
end


addHook("PlayerThink", SwapAbilities)

dont ask why its called swap abilities i changed the codes purpose and forgot to change the name
 

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

Back
Top