|
| 08 Feb 2015 01:03 AM |
function Click(mouse) for i,label in pairs(PlayerList:GetChildren()) do if label then if string.find(label.Name,"Slot") then target1.Value = label.Text end end end end script.Parent.PlayerList.label.MouseButton1Down:connect(Click)
How would I make it that if you click a button named Slot? I can't find a way, since there is Slot1, Slot2,Slot3 ... etc..
qq |
|
|
| Report Abuse |
|
|
| |
|
Ruinable
|
  |
| Joined: 14 Sep 2014 |
| Total Posts: 8903 |
|
|
| 08 Feb 2015 01:14 AM |
| findfirstchild, string.sub(1,4) |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 08 Feb 2015 01:24 AM |
to translate what ruinable said: function Click(mouse) for i,label in pairs(PlayerList:GetChildren()) do if label and string.sub(label.Name,1,4) == "Slot" then target1.Value = label.Text end end end script.Parent.PlayerList.label.MouseButton1Down:connect(Click)
AND THE TIGER GOES ROAR |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2015 01:25 AM |
function Click(mouse) for i, label in pairs(PlayerList:GetChildren()) do if label then if label.Name:match("^" .. "Slot") then target1.Value = label.Text end end end end
script.Parent.PlayerList.label.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2015 01:25 AM |
script.Parent.PlayerList.label.MouseButton1Down:connect(Click)
instead of label that needs to be slot, but idk how to make it so any slot is clicked |
|
|
| Report Abuse |
|
|
Ruinable
|
  |
| Joined: 14 Sep 2014 |
| Total Posts: 8903 |
|
|
| 08 Feb 2015 01:26 AM |
| I'm confused about what you're trying to do, so either try prags script or talk on skype in the morning. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2015 01:30 AM |
for i, v in pairs(PlayerList:GetChildren()) do if v.Name:match("^" .. "Slot") then v.MouseButton1Down:connect(function() target1.Value = v.Text end) end end
? |
|
|
| Report Abuse |
|
|