--local DisableBackpack = script:WaitForChild("DisableBackpack")

if Services.Players:GetPlayerFromCharacter(Character) and Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("PlayerGui") then
	TrackOrb.Parent = Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("PlayerGui")
	TrackOrb.Disabled = false
	
	--DisableBackpack.Parent = Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("PlayerGui")
	--DisableBackpack.Disabled = false
end

local UnequipLoop

UnequipLoop = Character.ChildAdded:Connect(function(child)
	if child:IsA("Tool") and Services.Players:GetPlayerFromCharacter(Character) and Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("Backpack") then
		--Humanoid:UnequipTools()
		Services.RunService.Stepped:Wait() --Wait at least 1 frame or that warning will occur
		child.Parent = Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("Backpack")
	end
end)

local floor = math.floor
for i=0,floor(60*(Properties.TravelTime)),1 do
	local Precentage = (i/(60*Properties.TravelTime))*100
	for t=1,#LightBallAnimations,1 do
		Bezier.Quadratic(Precentage,LightBallAnimations[t].Start,LightBallAnimations[t].Control,LightBallAnimations[t].End,LightBallAnimations[t].Object,"CFrame")
	end
	Services.RunService.Heartbeat:Wait()
end

for t=1,#LightBallAnimations,1 do
	if LightBallAnimations[t].Object then
		if LightBallAnimations[t].Object:FindFirstChildOfClass("ParticleEmitter") then
			LightBallAnimations[t].Object:FindFirstChildOfClass("ParticleEmitter").Enabled = false
		end
		LightBallAnimations[t].Object.Size = Vector3.new(1,1,1)*0
		LightBallAnimations[t].Object.Transparency = 1
		Services.Debris:AddItem(LightBallAnimations[t].Object,2)
	end
end
