|
| 08 Feb 2015 01:21 AM |
| http://www.roblox.com/Forum/ShowPost.aspx?PostID=155553138 |
|
|
| Report Abuse |
|
|
Unclear
|
  |
| Joined: 27 Aug 2011 |
| Total Posts: 17060 |
|
|
| 08 Feb 2015 01:23 AM |
Use a for loop and use concatenation.
for index = 1, N do -- N would be the largest number you have local buttonName = "Button" .. index -- event connection line here end
or... you can search for button
for _, child in next, parent:GetChildren() do -- parent would be where all the buttons are if child.Name:find("Button") then -- event connection line here end end |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2015 01:24 AM |
it has different numbers at end so:
slot1, slot2 and how many players ingame. |
|
|
| Report Abuse |
|
|
Unclear
|
  |
| Joined: 27 Aug 2011 |
| Total Posts: 17060 |
|
|
| 08 Feb 2015 01:26 AM |
find will match any pattern you give it, including "slot"
just iterate through all of the children of the object that contains the slot things
then check if the Name property has "slot"
if child.Name:find("slot") then
end
inside the conditional, put in an event connection hooking up to the button function |
|
|
| Report Abuse |
|
|