I know this is probably easy, but this is my first time doing anything like this and I’m really just trying to learn the best I can. I made a script already but it’s not working and I’d like to know why.
local tService = game:GetService("TeleportService")
local teleportOptions = Instance.new('TeleportOptions')
teleportOptions.ServerInstanceId = game.JobId
game.ReplicatedStorage.Teleport.OnClientEvent:Connect(function()
print("Message recieved")
tService:TeleportAsync(game.PlaceId, {userid}, teleportOptions)
end)
The error is “Unable to cast value to Object” on the line I’m trying to teleport.