I wanted to make gui button that when activated will teleport player to the same game but new server
You need to use TeleportService. First, place a localscript into your GUI. Inside the localscript, create a variable for the button. Then add a MouseButton1Up event and connect it to a function. Get the teleport service, and then run the function :Teleport() on the service, along with the game ID.
Your code should look something like this:
local button = script.Parent:WaitForChild("Frame"):WaitForChild("Button") -- put the path to the button here local teleportservice = game:GetService("TeleportService") -- get teleport service local ID = 523958034680934860 -- put your place ID here button.MouseButton1Up:Connect(function() -- add a mousebutton1 event here and connect it to a function teleportservice:Teleport(ID) -- teleports the player to the place end)