Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Part with clickdetector and script won't work?

Asked by
ali7682 17
6 years ago

Hi i made a script i have a part with a clickdetector and a script and if i click the part the things i coded in the script won't work and output doesn't say anything why? Btw the script is a normal script and i have FilteringEnabled OFF.

function onClicked()
wait(1)
game.StarterGui.Keys.Key1.Visible = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
0
You cannot use "game.StarterGui." IfIWasntSoSwag 98 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Check it at http://wiki.roblox.com/index.php?title=API:Class/ClickDetector/MouseClick

Your code should be

script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked) playerWhoClicked.PlayerGui.Keys.Key1.Visible = true
end)

Put it in script in part.

Ad

Answer this question