-- SA1 Tails flight by TeriosSonic
-- Free to use as long as you credit me.
-- Remember to add the SF_MULTIABILITY flag to your char and set his actionspd to 125 [normal SA1 Tails flight]
addHook("PlayerThink", function(player)
	if player.mo and player.mo.valid -- The player should be valid.
	and player.mo.skin == "sparrow" -- char name here
		if player.powers[pw_tailsfly] > 2*TICRATE -- If your flight timer is higher than 2 seconds...
		and not player.powers[pw_super] -- ...and you're not super...
			player.powers[pw_tailsfly] = 2*TICRATE -- ...it will be set to 2 seconds.
		end
		if player.bot == 1
			player.charflags = $ & ~SF_MULTIABILITY
		else
			player.charflags = $ |SF_MULTIABILITY
		end
		if player.powers[pw_super]
			player.actionspd = 110*FRACUNIT
		else
			player.actionspd = 150*FRACUNIT
		end
	end
end)