-
What do you want to achieve?
I want to achieve the next, i will put a context first.
I have a game that uses places, they are all attached to the main game (starter place)
When teleporting from a public server to an attached place, it will teleport you as spected. If you go to a VIP server of the game and get in the game and teleport to the other place, this will teleport you to a public version of that place, what i want to achieve is that when being in a VIP Server in the starter place, and you click teleport to that other place that is attached to the game, it has to teleport me to a private server version of that place, to make sence of the vip servers. -
What is the issue?
I get this error:
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Theres nothing regarding this in the developer forum.
This is the script i made, to explain what it does is basically when being in a public server, it will teleport you to the other linked place as usual, but when being in a private server (VIP server) it should teleport you to a private server version of the linked place. The actual behavior is that it doesn’t work and doesn’t go past the line 13 which is:
TeleportService:TeleportAsync(options, player)
local TeleportService = game:GetService("TeleportService")
local placeID_1 = 13243269808
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
local function onPartClick()
if game.PrivateServerId == "" then
TeleportService:Teleport(placeID_1, player)
else
local options = {
placeId = placeID_1,
serverInstanceId = game.PrivateServerId
}
TeleportService:TeleportAsync(options, player)
end
end
script.Parent.MouseButton1Click:Connect(onPartClick)
Thank you in advance.