addHook("PlayerThink", function(p) 
if player.mo.skin ~= "cheeseboi" then
if P_IsObjectOnGround(pmo) and not (p.pflags&PF_SPINNING) 
if (player.cmd.buttons & BT_CUSTOM1) then
player.mo.state = S_PLAY_GLIDE_LANDING
end
end
end
end)


//Cheese Throw
addHook("ThinkFrame", do
	for player in players.iterate
		if player.mo and player.mo.skin == "cheeseboi"
			if not (player.mo.cheese)
				player.mo.cheese = 0
			end
			if not (player.powers[pw_carry] == CR_NIGHTSMODE) 
			and not (player.powers[pw_carry]) 
			and not (player.pflags & PF_STASIS) 
			and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT) 
		and not (player.mo.state == S_PLAY_SUPER_TRANS1)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS2)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS3)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS4)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS5)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS6)
		and not (player.pflags & PF_FINISHED)
		and P_PlayerInPain(player) == false
		    and player.playerstate == PST_LIVE
			 and (player.cmd.buttons & BT_USE)
			and player.mo.cheese == 0
            player.mo.cheese = 1
		       local throw = P_SpawnPlayerMissile(player.mo, MT_CHEESEROCKET)
			end
			if not (player.cmd.buttons & BT_USE)
				player.mo.cheese = 0
			end
		end
	end
end)



addHook("PlayerThink", function(player)
    if not(player.mo and player.mo.valid and player.mo.skin == "cheeseboi" and player.mo.state == S_PLAY_DASH) then return end
    
        local ghost = P_SpawnGhostMobj(player.mo)
        ghost.fuse = 10
        ghost.colorized = true
        ghost.color = SKINCOLOR_GOLD
    end)