--I'm pretty sure that the Mid-Air Curl is from another game besides just Sonic Triple Trouble, but I haven't played that many sonic games so I wouldn't know anyway
//Script Made By StarManiaKG --With help from NARBlueBear
addHook("PlayerSpawn", function(player)
	if player.mo and player.mo.valid then
		player.springspinning = false
	end
end)

addHook("PlayerThink", function(player)
	if player.mo.skin == "paint_sonic" and player.mo.valid then
		if (P_IsObjectOnGround(player.mo) or (player.mo.eflags & MFE_JUSTHITFLOOR)) then
			player.springspinning = false
		end
		if player.mo.skin == "paint_sonic" and not (P_IsObjectOnGround(player.mo)) and player.springspinning == false and ((player.mo.state == S_PLAY_SPRING) or (player.mo.state == S_PLAY_FALL) or (player.mo.state == S_PLAY_PAIN)) and ((player.cmd.buttons & BT_JUMP) or (player.cmd.buttons & BT_SPIN)) then
			player.pflags = $1|PF_JUMPED
			player.mo.state = S_PLAY_JUMP
			player.springspinning = true
			if player.mo.skin == "paint_sonic" and (player.pflags & PF_SPINNING) then
				player.pflags = $1 & ~PF_SPINNING
			end
			if player.mo.skin == "paint_sonic" and (player.pflags & PF_THOKKED) then
				player.pflags = $1 & ~PF_THOKKED
			end
		end
	end
	if player.mo.skin == "paint_sonic"
	and player.mo.state == S_PLAY_MELEE_LANDING
	P_InstaThrust(player.mo, player.drawangle, player.speed)
	end
end)