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

Can anyone help me use clickdetectors to perform events when clicked?


How can I use a clickdetector to register when someone left clicks, when it registers the click I want it to turn the part the clickdetector and script is in to transparency = 1.

I've got some of my script this time, I think its what it should be but its not working:

MouseClick:connect(function(
 wait(1)
 script.Parent.Transparency = 0.9
end?

1 answer

✓ Accepted answer

Code:

script.Parent.MouseClick:Connect(function() -- Make sure this script is a child of the clickdetector
 wait(1)
 script.Parent.Parent.Transparency = 0.9
end)

MouseClick isn't recognized as an event in that script because you aren't telling the script what it's from. You must first add the path to the ClickDetector.

Also, I fixed the function.

1 comment

1

Thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.