Hello everyone, I've made a script that would teleport players to another game that is apart of the starter place but it ain't working. Any help?
Code:
local TeleportService = game:GetService("TeleportService")
local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
local code = TS:ReserveServer(5488852205)
function onPartTouch(otherPart)
local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
if player then
TS:TeleportToPrivateServer(5488852205,code,player)
end
end
script.Parent.Touched:Connect(onPartTouch)
The error that is shown on /console:
07:02:27 -- Unable to cast value to Objects Stack Begin Script 'Workspace.TeleporttoCabin.5.hello.script', Line 11 - function onPartTouch Stack End
Any support would be appreciated, thanks!

3 comments
Thanks it worked!
No problem.
Thank you, I was having the same problem and this fixed my problem! 2 years later!