Let's say I do this:
local getall = script.Parent.Characters:GetChildren()
I am trying to detect any of those buttons in that characters frame that have been hovered over or clicked without having to put a script in each one. Is there any way to do that?
Here's an example. All explaining is done in the script, sorry I can't explain it any better.
for _,v in pairs(script.Parent.Characters:GetChildren()) do -- Gather all them if v:IsA("TextButton") then -- You wouldn't want it to mouse over Script's v.MouseEnter:connect(function() -- Function print(v.Name) -- Print the name, you can edit this. end) -- End the function end -- End the if statement end -- End the gathering
If there are any error's please let me know, I didn't test it but I'm pretty sure it'll work.