Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Could someone help me on a teleportation issue?

Hierchy:

Sign

+Part

+Part

+Part

+Part

++ClickDetector

++Decal

++LocalScript

LocalScript Contents:

script.Parent.ClickDetector.MouseClick:connect(function()
	game:GetService("TeleportService"):Teleport(21916786)
end)

2 answers

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)

2 comments

0

Actually, that's the way the ClickDetector works. You 'click' the ClickDetector, so that part is fine.

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.