Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is this giving me a seemingly generic errror?

I have a teleportation script for a titlescreen of my game. When the event happens and the function is triggered. The error was this.

Unable to cast value to Object

script.Parent.MouseButton1Down:connect(function(player)
	local maingameid = 483825326
	local TeleportService = game:GetService("TeleportService")
	TeleportService:Teleport(player, maingameid)
end)

Can someone help me?

Please do not downvote without telling me why.

Will accept answer if it helps

1 comment

1 answer

✓ Accepted answer

MouseButton1Down does not return a player.

This discussion is preserved as it was. New answers, comments, and votes are closed.