generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: GetChildren

Previous Thread :: Next Thread 
1pie23 is not online. 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
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image