--//Jumping

local jumps = 0
local function ToggleFlying()
	if hum.FloorMaterial == Enum.Material.Air then --Is double jumping
		if jumps >= settings.ExtraJumps then return end
		jumps += 1
		
		hum:ChangeState(Enum.HumanoidStateType.Jumping) --Jump
		event:FireServer() --Tell other players that we are double jumping
		
		JumpEffect(char) --Visual Effect
	end
end
hum.StateChanged:connect(function(old, new) --Player landed
	if new == Enum.HumanoidStateType.Landed then
		jumps = 0
	end
end)
