I have this script that’s supposed to get teleportData to add to my teleport options (through the remote event), but I have this issue. Trying to teleport the player send this error, saying “Unable to cast value to Objects”. Here is my part of my teleport script that teleports the player.
local code = TS:ReserveServer(placeId)
local options = Instance.new("TeleportOptions")
options.ReservedServerAccessCode = code
for _, player in ipairs(playersToTeleport) do
game.ReplicatedStorage.GetPlayerUnits:FireClient(player)
end
local tpData
game.ReplicatedStorage.ReturnPlayerUnits.OnServerEvent:Connect(function(plr, first, second, third, fourth, fifth)
tpData = {
Unit1 = first,
Unit2 = second,
Unit3 = third,
Unit4 = fourth,
Unit5 = fifth
}
options:SetTeleportData(tpData)
st(placeId, plr, options) -- line of error
end)
btw, printing everything inside the safeTeleport (st) parameters prints MyPlaceId GoodGuy21938 Instance