I’m trying to teleport data with TeleportToPrivateServer to the same game, here is my script:
local TeleportService = game:GetService("TeleportService")
local player = script.Parent.Parent.Parent.Parent.Parent -- I am using a GUI to teleport, yes this is a server script.
script.Parent.MouseButton1Click:Connect(function()
local ReserveServer = TeleportService:ReserveServer(game.PlaceId)
local teleportData = {
ReservedServerCode = ReserveServer
}
TeleportService:TeleportToPrivateServer(game.PlaceId, ReserveServer, {player}, teleportData)
end)
when I run the script, I get an error saying
Unable to cast value to std::string -- (line 9)
Am I doing something wrong? I have never used teleportData before.