I’ve been recently trying to use the “ReserveServer” functions of the TeleportService.
However, when I’m trying to teleport, it says that.
My code:
function onCalled(player, place)
print(player, " - ", place) -- Don't mind that.
local tpS = game:GetService("TeleportService")
local code = tpS:ReserveServer(place)
print(code) -- Don't mind that either.
tpS:TeleportToPrivateServer(place, code, player) -- Line that errors.
end
game.ReplicatedStorage.TeleportPlayer.OnServerEvent:Connect(onCalled)
Maybe your using a global var. Add .value to the end to get its value. Not sure were. But that’s what I recognize the error being. Maybe place is the object?
You’ll still get the object values name when printing place. But to pass its value, you’ll need to specify.
I think you’re confusing global variables with Roblox’s Value objects. Global variables are just normal variables with a global scope, you don’t have to do anything special to get their values.
Also, player isn’t even a global variable. It’s a parameter to the onCalled function, so it’s localized to that function.