I have a bunch of models with ClickDetectors that do things. All with the same names, all duplicated models.
Currently, I have it working where each model has its own script inside, but I'm trying to cut down on number of scripts, to avoid 200+ scripts. So I'm trying to have one script apply to all the models.
I've got code the following so far:
local SELECTED = game.Workspace.Adam.equin:FindFirstChild("Right Arm")
local BUTTON = SELECTED:FindFirstChildWhichIsA("ClickDetector")
local SHIRT = BUTTON.Parent.Parent:FindFirstChildWhichIsA("Shirt")
BUTTON.MouseClick:connect(function(Player)
print("Hello")
end)
However, this only works on one of the models since it's only finding the first child... mind pointing me in the right direction? -please explain like I'm 5, I'm an inexperienced coder.
Note: I've looked into GetChildren() and loops, but none of that really makes too much sense to me.
