|
| 27 Aug 2015 08:08 PM |
I'm not too sure how to word this..
How would I make this:
script.Parent.Frame.NA1.MouseButton1Click:connect(function() -- script end)
script.Parent.Frame.NA2.MouseButton1Click:connect(function() -- script end)
script.Parent.Frame.NA3.MouseButton1Click:connect(function() -- script end)
ect ect
How could I make this easier to navigate (There is going to be 50 in total so it would be loads of faff to do it like this.) I'm stumped I'd need to be able to access the button that was clicked easily though.
Any ideas? |
|
|
| Report Abuse |
|
|
Robotized
|
  |
| Joined: 14 Feb 2010 |
| Total Posts: 167 |
|
|
| 27 Aug 2015 08:10 PM |
local function NA1_mb1_click() --allahu akbar end
script.Parent.Frame.NA1.MouseButton1Click:connect(NA1_mb_click()) |
|
|
| Report Abuse |
|
|
solarDEV
|
  |
| Joined: 23 May 2014 |
| Total Posts: 1767 |
|
|
| 27 Aug 2015 08:11 PM |
for _,v in pairs(script.Parent.Frame:GetChildren()) do v.MouseButton1Click:connect(function() --script end) end
assuming they all have the same functionality, otherwise you need to handle them each separately. |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2015 08:12 PM |
| @Above thanks, lifesaver :) |
|
|
| Report Abuse |
|
|