Hi! So my teleportation script keeps erroring saying it cannot cast string into int64, and I don’t understand what is wrong. Can anybody help me?
local success, errorMessage, placeId, jobId = pcall(function()
if success then
-- Teleport player
game:GetService("TeleportService"):TeleportToPlaceInstance(placeId, jobId, plr) --Error is located here.
Your pcall set errorMessage into a variable instead. Print out all the variables to see exactly why. There is no error message since all of its variables are returned in order starting from the second and so on.
An arbitrary test on pcall reveals:
local a, b, c = pcall(function()
return "a", "cee", "LOL"
print(a, b, c) -- true, "a", "cee"