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

How would i be able to manage/use multiple click detectors in different parts with one script?

Asked by
Zeloi 40
9 years ago

Ok so i have multiple parts in one model. Each one has a click detector and a script. I want to be able to use click detectors with one script as a child of the model. -Workspace -model -script -part -click detector -part -click detector -part -click detector -part -click detector

I tried using a for loop but you have to wait to click one specific part before you can click the second specific part...

0
Ignore the -Workspace -model -script -part -click detector -part -click detector -part -click detector -part -click detector Zeloi 40 — 9y
0
This was one year ago and you probably figured this out but to heck with it. Use a for loop to get all click detectors and connect them to function within. Less code, can't say it's more efficient but... AZDev 590 — 8y

1 answer

Log in to vote
0
Answered by 9 years ago

You can just put as many functions as you want in one script.

PART.ClickDetector.MouseClick:connect(function()
stuff
end)
PART.ClickDetector.MouseClick:connect(function()
stuff
end)
PART.ClickDetector.MouseClick:connect(function()
stuff
end)

and so on

Ad

Answer this question