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
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 25 Nov 2013 12:15 AM |
| why would there be a hat in workspace/ |
|
|
| Report Abuse |
|
|
CarlosMX
|
  |
| Joined: 30 Apr 2011 |
| Total Posts: 791 |
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 25 Nov 2013 01:53 AM |
| Hat should not be in workspace. That will be an error. |
|
|
| Report Abuse |
|
|
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 |
|
|