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 » Scripters
Home Search
 

Re: Removing Any hats

Previous Thread :: Next Thread 
fwep67 is not online. fwep67
Joined: 21 Nov 2009
Total Posts: 352
18 Jan 2015 12:46 PM
So im trying to make a script where it changes any characters cloths and hat to anything, how do I get rid of the hats inside their character if they are named various titles.
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
18 Jan 2015 01:06 PM
for i,v in pairs(workspace.Playername:GetChildren()) do
if v.ClassName == "Hat" then
v:Destroy()
end
end
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
18 Jan 2015 01:10 PM
no you dont want to do it like that ohno


@OP

for i, v in pairs(char:GetChildren())) do
if v:IsA'Hat' then
v:Destroy()
end
end
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
18 Jan 2015 01:16 PM
If they are various titles?

local hatNames = {"Dominus Empyreus","Hat","OtherHat"}

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
char:WaitForChild("Torso");wait(.5)
for i,v in pairs(char:GetChildren()) do
if v:IsA("Hat") then
for a,b in pairs(hatNames) do
if v.Name == b then
v:Destroy()
end
end
end
end
end)
end)


Just removing all hats?

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(functon(char)
char:WaitForChild'Torso';wait'.5';
for i,v in pairs(char:GetChildren'') do
if v:IsA'Hat' then
v:Destroy''
end
end
end)
end)
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
18 Jan 2015 01:17 PM
Don't do what GoulStem said for the title thing, it would technically work but you'd have to know the name of the actual hat in Studio. They usually give the hats very odd names (sometimes as jokes) and so it won't really work.

Just remove all hats.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
18 Jan 2015 01:20 PM
^m8. don't bash on me just because it's a terrible way to do it, I know that.. but he asked for it lol.

"...how do I get rid of the hats inside their character if they are named various titles."

~OP
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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