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: Why won't this work?

Previous Thread :: Next Thread 
Wolater is not online. Wolater
Joined: 06 Mar 2011
Total Posts: 2786
25 Nov 2013 12:10 AM
for _,v in pairs(game.Workspace:GetChildren()) do
if v:IsA("Hat") then
v:Destroy()
end
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Nov 2013 12:15 AM
why would there be a hat in workspace/
Report Abuse
CarlosMX is not online. CarlosMX
Joined: 30 Apr 2011
Total Posts: 791
25 Nov 2013 12:16 AM
yeah?
Report Abuse
CarlosMX is not online. CarlosMX
Joined: 30 Apr 2011
Total Posts: 791
25 Nov 2013 12:17 AM
Try adding an extra 'end' and a while true do
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
25 Nov 2013 12:37 AM
You need to use a recursive function to get every hat. GetChildren only returns children directly under a parent.
Report Abuse
Arkose is not online. Arkose
Joined: 26 May 2013
Total Posts: 745
25 Nov 2013 01:25 AM
Are you trying to remove hats that are dropped by players?
Report Abuse
ScriptNHelper is not online. ScriptNHelper
Joined: 15 Oct 2013
Total Posts: 1600
25 Nov 2013 01:53 AM
Hat should not be in workspace. That will be an error.
Report Abuse
CarlosMX is not online. CarlosMX
Joined: 30 Apr 2011
Total Posts: 791
25 Nov 2013 01:57 AM
Why not remove the player's hat when they join game.
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