addHook("PlayerThink", function(player) if player.bouncing == nil then player.bouncing = false end if (player.cmd.buttons & BT_SPIN) and not (player.lastbuttons & BT_SPIN) and not P_IsObjectOnGround(player.mo) and not (player.mo.state == S_PLAY_MELEE) then local thokspeed = 15 if player.mo.eflags & MFE_UNDERWATER then thokspeed = thokspeed/2 end S_StartSound(player.mo, sfx_thok) P_SetObjectMomZ(player.mo, -thokspeed*FRACUNIT, false) P_SpawnThokMobj(player) player.pflags = $|PF_SPINNING player.mo.state = S_PLAY_ROLL player.bouncing = true end if P_IsObjectOnGround(player.mo) and player.bouncing==true then player.bouncing = false local thokspeed = 11 if player.mo.eflags & MFE_UNDERWATER then thokspeed = thokspeed/2 end S_StartSound(player.mo, sfx_bnce2) P_SetObjectMomZ(player.mo, thokspeed*FRACUNIT, false) P_SpawnThokMobj(player) player.pflags = $1 & ~PF_SPINNING player.mo.state = S_PLAY_SPRING end if player.bouncing==true then A_GhostMe(player.mo,8,8) end end)