|
| 29 Aug 2011 10:23 AM |
function onTouched() wait(5) s1 = "There are " s2 = " children in the game!" c = #game.Workspace.GetChildren() print(s1 + c + s2) end
script.Parent.Touched.connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 10:25 AM |
function onTouched() wait(5) c = #game.Workspace:GetChildren() print("There are ", c, " children in the game") end
script.Parent.Touched.connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 10:29 AM |
What should it say in the output in edit mode? Because I got
Mon Aug 29 11:26:59 2011 - Touched is not a valid member of Workspace Mon Aug 29 11:26:59 2011 - Script "Workspace.Script", Line 7 Mon Aug 29 11:26:59 2011 - stack end |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 10:29 AM |
...
The script needs to go in a Part. |
|
|
| Report Abuse |
|
|
| |
|
tdog158
|
  |
| Joined: 08 Jul 2008 |
| Total Posts: 5413 |
|
| |
|
|
| 29 Aug 2011 10:34 AM |
Mon Aug 29 11:32:28 2011 - Workspace.Part.Script:7: bad argument #1 to 'connect' (RBXScriptSignal expected, got function) Mon Aug 29 11:32:28 2011 - Script "Workspace.Part.Script", Line 7 Mon Aug 29 11:32:28 2011 - stack end |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 10:35 AM |
Sorry, there was one mistake I forgot to fix.
function onTouched() wait(5) c = #game.Workspace:GetChildren() print("There are ", c, " children in the game") end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 10:38 AM |
| Oh thanks. Cause I was going to make a scripting tutorial. All others worked except that. And it's going to be a beginner tutorial. |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 10:39 AM |
| Cool, but just remember, methods use a colon (:) not a period (.). :P |
|
|
| Report Abuse |
|
|
| |
|