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.
[Edit: Please respond to me fast because I'm in a rush of making this game]
Script 1 (Local script, Inside a button called Server1):
local Select = game:GetService("ReplicatedStorage").Select
local Teleport = script.Parent.Parent.Parent.Teleporting
local RS = game:GetService("ReplicatedStorage")
local TPEvent = RS.TPEvent
script.Parent.MouseButton1Click:Connect(function()
Select:Play()
Teleport.Visible = true
Teleport:TweenPosition(UDim2.new(0, 0, 0, -3), "In", "Quad")
TPEvent:FireServer(script.Parent.Name)
end)
Script 2 (Script, Inside ServerScriptService):
local RS = game:GetService("ReplicatedStorage")
local TPEvent = RS.TPEvent
TPEvent.OnServerEvent:Connect(function(plr, server)
plr.Character.Humanoid.WalkSpeed = 16
plr.Character.Humanoid.JumpPower = 50
local Teleport = plr:WaitForChild("PlayerGui"):WaitForChild("MainUI").Teleporting
wait(1) -- TweenPosition delay
wait(0.2)
Teleport.BackgroundColor3 = Color3.new(150, 150, 150) -- Makes it gray
wait(0.2)
if server == "Server1" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-39.109, 0, 104.624) + Vector3.new(0, 50, 0)
elseif server == "Server2" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-68.079, 0, 133.366) + Vector3.new(0, 50, 0)
elseif server == "Server3" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-12.131, 0., 104.608) + Vector3.new(0, 50, 0)
elseif server == "Server4" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-67.991, 0, 104.952) + Vector3.new(0, 50, 0)
elseif server == "Server5" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-39.931, 0, 133.366) + Vector3.new(0, 50, 0)
elseif server == "Server6" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-13.286, 0, 133.366) + Vector3.new(0, 50, 0)
elseif server == "Server7" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-68.079, 0, 160.401) + Vector3.new(0, 50, 0)
elseif server == "Server8" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-39.676, 0, 160.401) + Vector3.new(0, 50, 0)
elseif server == "Server9" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-13.541, 0, 160.401) + Vector3.new(0, 50, 0)
elseif server == "Server10" then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(-13.541, 0, 186.562) + Vector3.new(0, 50, 0)
end
Teleport:TweenPosition(UDim2.new(2, 0, 0, -3), "Out", "Quad")
wait(1) -- TweenPosition delay
Teleport.Visible = false
end)
I would really appreciate it if you help me with my problem, Plus I'll accept your answer if it worked for me.
Thanks, MajinBluee

4 comments
I put "Title Specific" in the title so it doesn't annoy me.
PlayerGui cannot be modified from the Server.
Oh.. LOL.
Thank you.