I currently have a script that teleports a number through the teleport service with the player, but currently it is saying giving me this error:
Unable to cast value to Objects
and it errors when I call for a teleport.
Here is my code:
local TeleportService = game:GetService("TeleportService")
print("ok")
game.ReplicatedStorage.Teleport.OnServerEvent:Connect(function(player,teleportData) -- TeleportData is a number, I have it currently set at 1.
print("okgotit") -- Just to make sure its working
--local reservId = TeleportService:ReserveServer(-) ignore this, old stuff
print("sending") -- Just to make sure its working
TeleportService:TeleportPartyAsync(-removedplaceid-,player,teleportData,script.Load) --Removed the place id, it is correct though.
end)
I am asking for your help, as whatever I have tried is not working.
Any help is appreciated. Thanks!
If your reply is unrelated to the error I am receiving, I kindly ask you could just message me about it or any other means of informing me, as I am only looking for the solution to this error and don’t want to crowd the replies. Thanks!