Making a Clickable brick that teleports you to another game?
Hi, I'm currently working on a teleport button that teleports you to another game when you click it instead of stepping over it. I went off with the onTouch first, to see how it works and it does. But, when I try to make a click function of it, it doesn't work at all.
I put the click detector in a part, and then a script in the part. and the part is in workspace.
01 | local TeleportService = game:GetService( "TeleportService" ) |
03 | local placeID_ 1 = 4505065903 |
04 | local placeID_ 2 = 4483453486 |
06 | script.Parent.ClickDetector.MouseClick:Connect( function () |
07 | local player = game.Players:GetPlayerFromCharacter(script.Player) |
09 | TeleportService:Teleport(placeID_ 1 , player) |
I didn't know exactly what to put in where it says "script.Player" so can I get help on that too??
Image here: https://gyazo.com/6865b0516ac27265ad2f02cf1bceada2