1pie23
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 1865 |
|
|
| 10 Feb 2012 06:39 PM |
How do you print a GetChildren, and why is this not working:
for i = 1,#g do if g[i] < 50 then sink() end end
output:
19:38:09 - Workspace.Warship.Boat.Health:22: attempt to compare userdata with number 19:38:09 - Script "Workspace.Warship.Boat.Health", Line 22 19:38:09 - stack end
|
|
|
| Report Abuse |
|
|
|
| 10 Feb 2012 06:43 PM |
g = game.Workspace.Warship.Boat.Health:GetChildren()
for i=1, #g do if g[i] < 50 then sink() end end
well my freind it seems like you done this?
try this
while true do wait(0.1) if (game.Workspace.Warship.Boat.Health < 50) then sink() end end |
|
|
| Report Abuse |
|
|
1pie23
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 1865 |
|
|
| 10 Feb 2012 06:44 PM |
| it's supposed to check if the number of parts left in the boat is less then 50. |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2012 06:46 PM |
@Cody
Heck no. o.o
Maybe:
for i = 1, #g do if #g < 50 then sink() end end
?
† KMXD † |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Feb 2012 07:33 PM |
This is how I'd do it...
Btw, never defined g :l
for i,v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") and i <=50 then print("Whatever") end end
I didn't really no what you wanted I just looked at knightmare and followed his script through :P |
|
|
| Report Abuse |
|
|