addHook("PlayerThink", function(player) -- runs once per player each frame
if player.mo.skin ~= "sonic" then --change sonic to your character's name
return
end -- this part checks if the player is playing as a certain character and if not, it doesn't do the rest of the script
if player.justthokked == nil then
player.justthokked = false
end --this creates a new field within the player
if (player.pflags & PF_THOKKED)
and player.justthokked == false then
player.mo.momz = -15*FRACUNIT
player.justthokked = true
end --this part checks if the player used their ability and then sends them down
if player.justthokked == true then
player.mo.momz = $ - 1*FRACUNIT/2
end --this adds gravity because i had no idea how to add real gravity
if not (player.pflags & PF_THOKKED) then
player.justthokked = false
end --this makes sure that the gravity doesn't get added unless an ability is used
end)