|
| 12 Jul 2011 07:19 AM |
| Okay, so I have around 50 bricks in my Model named Part. I now want to make it so I only ahve to do one line of Scripting to effect all of them... Would [blah blah blah].Part.Anchored = false work on all of them or would I have to do something different (I can't test 'cause I'm on my sisters laptop...) ? |
|
|
| Report Abuse |
|
|
|
| 12 Jul 2011 07:36 AM |
for _, v in pairs(model:children()) do --Do stuff to bricks end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 12 Jul 2011 07:57 AM |
local isOn = false model = script.Parent.Debris
function on() isOn = true wait() for _, v in pairs(model:children()) do Transparency = 0 Anchored = false end end
function off() isOn = false wait() for _, v in pairs(model:children()) do Transparency = 1 Anchored = true end end
function onChatted(msg, speaker) if msg:lower() == "debris" then do if isOn == true then off() else on() end end end end
game.Players.PlayerAdded:connect(function(player) if player:IsInGroup(106362) then player.Chatted:connect(function(msg) onChatted(msg, newPlayer) end) end end)
Doesn't work, yet the Output has come up with no errors... |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 12 Jul 2011 08:08 AM |
| Ohh, thanks! I've never used pairs before... |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|