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: How do you remove a player's hats?

Previous Thread :: Next Thread 
TNTxERIC is not online. 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 is not online. 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 is not online. TNTxERIC
Joined: 20 Nov 2010
Total Posts: 2689
21 May 2012 07:20 AM
@Jlobbet
That only removed 1 hat
Report Abuse
jelly134 is not online. 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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
21 May 2012 07:40 AM
[ Content Deleted ]
Report Abuse
TNTxERIC is not online. TNTxERIC
Joined: 20 Nov 2010
Total Posts: 2689
21 May 2012 07:52 AM
@Trioxide that removes 2
Report Abuse
TNTxERIC is not online. TNTxERIC
Joined: 20 Nov 2010
Total Posts: 2689
21 May 2012 08:02 AM
I fixed it now

-pointless siggy-
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
21 May 2012 08:06 AM
[ Content Deleted ]
Report Abuse
TNTxERIC is not online. 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 is not online. 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
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