-
What do you want to achieve?
The player to teleport without an issue -
What is the issue? Include screenshots / videos if possible!
The title displays the error code when attempting to teleport
I know the issue isn’t in the firing of the event, its the teleport that causes the error (and doesn’t work of course.)
local rp = game:GetService("ReplicatedStorage")
local sendEvent = rp:FindFirstChild("Make_Server")
local ts = game:GetService("TeleportService")
sendEvent.OnServerEvent:Connect(function(player, difficulty, place)
local dif
local code
if difficulty == 1 then
dif = "easy"
elseif difficulty == 2 then
dif = "medium"
else
dif = "hard"
end
if place == "iceCaves" then
code = 698944913
end
print(code)
print(dif)
local reserve = ts:ReserveServer(code)
ts:TeleportToPrivateServer(code, reserve, player, nil, dif)
end)