Can anyone tell me why this doesn't error creating the server, but when teleporting? The purpose for it is I want it to create a vip server(without people having to pay robux) then automatically teleport them to the server.
Code:
local Player = script.Parent.Parent.Parent.Parent local TeleportService = game:GetService("TeleportService") script.Parent.MouseButton1Click:connect(function() print("Creating Place") local Place = TeleportService:ReserveServer(game.PlaceId) print("Teleporting Player") wait(0.30) TeleportService:Teleport(Place,Player) end)
Error output gives is unable to cast string to int
on line 9.
Any help appreciated.
You're actually using the wrong method to teleport to a reserved server!
The method you're looking for is called TeleportToPrivateServer
local Player = script.Parent.Parent.Parent.Parent local TeleportService = game:GetService("TeleportService") script.Parent.MouseButton1Click:connect(function() print("Creating Place") local Place = TeleportService:ReserveServer(game.PlaceId) print("Teleporting Player") wait(0.30) TeleportService:TeleportToPrivateServer(game.PlaceId, Place, {Player}) end)