Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What does "Unable to cast value to object" mean in my teleport service local script?

Asked by 6 years ago

I have a local script located in my gui text button and if the user clicks the button, they teleport to another place. But for some reason on the output it says: "Unable to cast value to object". and also it doesn't teleport me.

local TeleportService = game:GetService("TeleportService")

local lobby = 1357679361

script.Parent.Parent.Play.MouseButton1Down:connect(function(player)
    TeleportService:Teleport(lobby, player)
end)

i really need help on this. Means a lot to me for a solution. Thanks.

0
I don't think this stuff works in localscripts greatneil80 2647 — 6y

Answer this question