Hello, So I'm trying to make a server selection GUI and I have a GUI of teleportation. If I play in studio it works fine, If I play in-game it doesn't work, It doesn't teleport and the GUI doesn't go away. I don't have any errors on both platforms.
This is the script I'm using:
script.Parent.Changed:Connect(function()
if script.Parent.Visible == true and script.Parent.Position == UDim2.new(0, 0, 0, -3) then
wait(1) -- TweenPosition delay
wait(0.3)
script.Parent.BackgroundColor3 = Color3.new(150, 150, 150)
local ServerName
local function FindServer()
for i, v in pairs(script.Parent.Parent.CurrentServers:GetChildren()) do
if v:FindFirstChild("ServerSelected") then
if v:FindFirstChild("ServerSelected").Value == true then
ServerName = v.Name
v:FindFirstChild("ServerSelected").Value = false
end
end
end
end
FindServer()
if ServerName == "Server1" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-39.109, 0, 104.624) + Vector3.new(0, 50, 0)
elseif ServerName == "Server2" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-68.079, 0, 133.366) + Vector3.new(0, 50, 0)
elseif ServerName == "Server3" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-12.131, 0., 104.608) + Vector3.new(0, 50, 0)
elseif ServerName == "Server4" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-67.991, 0, 104.952) + Vector3.new(0, 50, 0)
elseif ServerName == "Server5" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-39.931, 0, 133.366) + Vector3.new(0, 50, 0)
elseif ServerName == "Server6" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-13.286, 0, 133.366) + Vector3.new(0, 50, 0)
elseif ServerName == "Server7" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-68.079, 0, 160.401) + Vector3.new(0, 50, 0)
elseif ServerName == "Server8" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-39.676, 0, 160.401) + Vector3.new(0, 50, 0)
elseif ServerName == "Server9" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-13.541, 0, 160.401) + Vector3.new(0, 50, 0)
elseif ServerName == "Server10" then
script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-13.541, 0, 186.562) + Vector3.new(0, 50, 0)
end
script.Parent:TweenPosition(UDim2.new(2, 0, 0, -3), "Out", "Quad")
wait(1) -- TweenPosition delay
script.Parent.Visible = false
end
end)
I would really appreciate it if you will help me with my problem, Plus I'll accept your answer.
Thanks, MajinBluee

5 comments
I added [Title is specific] so it doesn't annoy me.
Can you fix the script blocks first? Remember that you can use 'Preview'. Also make sure the code is UNDER the ~~~~ and ABOVE the other ~~~~. Don't put the code after the ~~~~.
Oh, Didn't see that.
Is the game FE?
Yes