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

What is a click detector?

Asked by 8 years ago

I found something in the objects that is a click detector.

What exactly is it and what is it's pourpose?

1 answer

Log in to vote
0
Answered by 8 years ago

You can place click detectors into parts and use scripts to do things when the pat is clicked by a players mouse. Let's say you have a part in workspace and you put a click detector and a script into that part. The script would look like this,

script.Parent.ClickDetector.Mouse1Click:connect(function()
    script.Parent.BrickColor = BrickColor.new(255,0,0)
end

This would change the parts brick color to red. This may have errors mainly to do with the name of property's because I'm writing this from memory but this should hopefully work. You can make the script do other things when the part is clicked too. Good luck!

Ad

Answer this question