Why does my Tp to private server script not work?
Asked by
5 years ago Edited 5 years ago
So I was trying to make a script based off the Roblox developer website (https://developer.roblox.com/en-us/api-reference/function/TeleportService/TeleportToPrivateServer) that TPs players to a private server that no one else can join (like in camping 1 and 2) when a brick is clicked and it wouldn't work. I know the problem is the reserve server code argument and have tried to fix it in many ways but it doesn't seem to work. Can someone please fix it for me?
1 | local TS = game:GetService( "TeleportService" ) |
2 | local Players = game:GetService( "Players" ) |
3 | local players = Players:GetPlayers() |
4 | local ClickDetector = script.Parent |
5 | local code = TS:ReserveServer() |
7 | ClickDetector.MouseClick:Connect( function () |
8 | TS:TeleportToPrivate( 3926134089 ,code,players) |