01 | local TeleportService = game:GetService( "TeleportService" ) |
02 | local gameID = 1276220417 |
03 |
04 | function onTouched() |
05 | local player = Clicked.Parent |
06 | TeleportService:Teleport(gameID, player) |
07 | end |
08 |
09 |
10 | script.Parent.MouseButton 1 Click:connect(onTouched) |
the local player doesnt work on it, any ideas?
To reference the local player you do this
1 | local player = game.Players.LocalPlayer |
I’m not completely sure about this but I think you have to set a variable for the player using local player instead of clicked.Parent but when you are using the variable for teleporting put .UserId after it.