hi, im having an issue where my parts are randomly deleting when i join and im trying to make it so you teleport when you click a gui, but it says infinite yield possible on: etc…
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local leaderstats = plr:WaitForChild("leaderstats")
local collectedFile = plr.BillysCollected
local char = plr.Character or plr.CharacterAdded:Wait()
local plrGui = plr:WaitForChild("PlayerGui")
local TS = game:GetService('TweenService')
local RS = game:GetService("ReplicatedStorage")
local Debounce = false
local Toggle = script.Parent.Parent.Parent.Toggle
script.Parent.MouseButton1Up:Connect(function()
if Debounce == false then
Debounce = true
char:MoveTo(workspace.Spawns:WaitForChild("SpaceWorldSpawn").Position + Vector3.new(0,5,0))
script.Parent.Parent.Parent:TweenSize(UDim2.new(0,0,0,0),"Out","Back",.35,true)
wait(0.35)
script.Parent.Parent.Parent.Visible = false
Toggle = false
wait(0.5)
Debounce = false
end
end)