lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 13 Jun 2013 03:48 PM |
Change is a function in my code* #workspace.children().Changed:connect(Change)
Out put has a problem with the number sign. print(#workspace.children()) worked for me.
~ The ATR Fishie ~ |
|
|
| Report Abuse |
|
|
getkoed2
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 1144 |
|
|
| 13 Jun 2013 03:50 PM |
local v = Instance.new("IntValue", script) v.Name = "stuff" v.Value = #workspace:GetChildren()
workspace.ChildAdded:connect(function() v.Value = #workspace:GetChildren() end)
v.Changed:connect(function() print(v.Value) end) |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 04:37 PM |
@get: That will only run when a child is added to the workspace. It won't function for items already in it.
function objChanged(o) --do stuff you need to here. "o" is the item that changed. end
for i,v in pairs(workspace:GetChildren()) do v.Changed:connect(function(objChanged) end |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 04:39 PM |
for i,v in pairs(etc) runs through the items in the workspace where i is the number of the item, and v is the item itself.
v.Changed runs when the v changes and sends v(the object) to function ObjChanged. |
|
|
| Report Abuse |
|
|
getkoed2
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 1144 |
|
|
| 14 Jun 2013 06:07 AM |
@Echo As soon as something gets in workspace, like a character, it already shows how many children workspace has. |
|
|
| Report Abuse |
|
|