iValianT
|
  |
| Joined: 21 Aug 2010 |
| Total Posts: 58381 |
|
|
| 21 Jan 2014 12:52 AM |
How would I script this Changed Event so that it applies to all Parts inside the Model?
Model:GetChildren().Changed:connect(function(Property) |
|
|
| Report Abuse |
|
|
iValianT
|
  |
| Joined: 21 Aug 2010 |
| Total Posts: 58381 |
|
| |
|
michael82
|
  |
| Joined: 30 Aug 2008 |
| Total Posts: 101 |
|
|
| 21 Jan 2014 01:13 AM |
| Why not refer it to one name inside the model. So, basically you name all the parts in that model the same name boom there you go. |
|
|
| Report Abuse |
|
|
iValianT
|
  |
| Joined: 21 Aug 2010 |
| Total Posts: 58381 |
|
|
| 21 Jan 2014 01:13 AM |
| that wont work with what i'm scripting |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 21 Jan 2014 01:15 AM |
for i,v in pairs(script.Parent:GetChildren()) do v.Changed:connect(function() print(v.Name.. " changed") end) end |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 21 Jan 2014 01:16 AM |
| Except don't put the script inside the same model, because it will error. |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
| |
|
iValianT
|
  |
| Joined: 21 Aug 2010 |
| Total Posts: 58381 |
|
| |
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 21 Jan 2014 01:37 AM |
--Azarth's won't work and he knows why but he's close:
for i,v in pairs(script.Parent:GetChildren()) do if v.ClassName ~="Script" then v.Changed:connect(function() --code end) end end
--Now this should work I RBI k. |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 21 Jan 2014 01:41 AM |
| Works fine with scripts, that's why I redacted what I said. |
|
|
| Report Abuse |
|
|