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
1 | script.Parent.MouseButton 1 Down:connect( function (player) |
2 | local maingameid = 483825326 |
3 | local TeleportService = game:GetService( "TeleportService" ) |
4 | TeleportService:Teleport(player, maingameid) |
5 | end ) |
Can someone help me?
Please do not downvote without telling me why.
Will accept answer if it helps