Hierchy:
Sign
+Part
+Part
+Part
+Part
++ClickDetector
++Decal
++LocalScript
LocalScript Contents:
script.Parent.ClickDetector.MouseClick:connect(function()
game:GetService("TeleportService"):Teleport(21916786)
end)
Hierchy:
Sign
+Part
+Part
+Part
+Part
++ClickDetector
++Decal
++LocalScript
LocalScript Contents:
script.Parent.ClickDetector.MouseClick:connect(function()
game:GetService("TeleportService"):Teleport(21916786)
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:
script.Parent.MouseClick:connect(function()--Instead of clicking the clickdetector, we are clicking the parent of the script, or part.
game:GetService("TeleportService"):Teleport(21916786)
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.
script.Parent.ClickDetector.MouseClick:connect(function(Player) --The player who clicked on the part
game:GetService("TeleportService"):Teleport(21916786, Player)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
http://www.roblox.com/PlaceHolder-place?id=127285201 Try it for yourself. :P
Actually, that's the way the ClickDetector works. You 'click' the ClickDetector, so that part is fine.