TNTxERIC
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2689 |
|
|
| 21 May 2012 05:46 AM |
| I'm making a OnTouch script and I'm using the variable "h" for the Humanoid, I want to know how do you remove the players hats using h.Parent? Thanks in advance. |
|
|
| Report Abuse |
|
|
Jlobblet
|
  |
| Joined: 05 Sep 2010 |
| Total Posts: 587 |
|
|
| 21 May 2012 06:11 AM |
local v = h.Parent:getChildren()
for index = 1,#v,1 do if v[index]:IsA("Hat") then v[index]:Destroy() end end |
|
|
| Report Abuse |
|
|
TNTxERIC
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2689 |
|
|
| 21 May 2012 07:20 AM |
@Jlobbet That only removed 1 hat |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 21 May 2012 07:34 AM |
C = h.Parent:GetChildren() for i=1, #C do if C[i].className == "Hat" then C[i]:remove() end end |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
TNTxERIC
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2689 |
|
| |
|
TNTxERIC
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2689 |
|
|
| 21 May 2012 08:02 AM |
I fixed it now
-pointless siggy- |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
TNTxERIC
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2689 |
|
|
| 21 May 2012 08:37 AM |
Well I wear 3 hats, it's supposed to remove all the hats, but I fixed it now, I put the hats in the workspace then removed them, that worked
-pointless siggy- |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 21 May 2012 10:18 AM |
| well, they were probably unrchivable. Also, InPairs would obviously only do 2, as 3 isn't a multiple of two. |
|
|
| Report Abuse |
|
|