Hierchy:
Sign
+Part
+Part
+Part
+Part
++ClickDetector
++Decal
++LocalScript
LocalScript Contents:
1 | script.Parent.ClickDetector.MouseClick:connect( function () |
2 | game:GetService( "TeleportService" ):Teleport( 21916786 ) |
3 | end ) |
On a hunch, because I don't really know the difference between local scripts and scripts, try putting that code into a script.
Another hunch is that you are not clicking the clickdetector, you are clicking the brick. Try:
1 | script.Parent.MouseClick:connect( function () --Instead of clicking the clickdetector, we are clicking the parent of the script, or part. |
2 | game:GetService( "TeleportService" ):Teleport( 21916786 ) |
3 | end ) |
Put it in a normal script, LocalScripts run on Players, and can only be put in StarterGui or StarterPack.
Your script was fine, you just needed to add the actual Player part of it.
1 | script.Parent.ClickDetector.MouseClick:connect( function (Player) --The player who clicked on the part |
2 | game:GetService( "TeleportService" ):Teleport( 21916786 , Player) |
3 | end ) |