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: Hat remover script?

Previous Thread :: Next Thread 
Flamehead1 is not online. Flamehead1
Joined: 18 Dec 2007
Total Posts: 3406
25 Jun 2013 11:11 PM
I'l trying to find a hat remover script in Free Models.

yes, I said free models. I'm trying to learn.
Report Abuse
Flamehead1 is not online. Flamehead1
Joined: 18 Dec 2007
Total Posts: 3406
25 Jun 2013 11:12 PM
Bump
Report Abuse
LUVMARIOLUIGI10000 is not online. LUVMARIOLUIGI10000
Joined: 16 May 2009
Total Posts: 1244
25 Jun 2013 11:14 PM
game.Workspace.ChildAdded:connect(function(child)
if child:IsA("Hat") then
child:Destroy()
end
end)

--Like that?
Report Abuse
Flamehead1 is not online. Flamehead1
Joined: 18 Dec 2007
Total Posts: 3406
25 Jun 2013 11:17 PM
Didn't work.
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
25 Jun 2013 11:20 PM
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
wait(3)
Search = Character:GetChildren()
for i = 1, #Search do
if(Search[i].ClassName == "Hat")then
Search[i]:Destroy()
end
end
end)
end)

c:?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Jun 2013 11:20 PM
That would remove hats that you remove from yourself pressing the backspace key. If you mean when someone spawns, do something like:

    Game.Players.PlayerAdded:connect(function(Player)
      Player.CharacterAdded:connect(function(Character)
        Character:WaitForChild("Humanoid")
        for Index, Child in pairs(Character:GetChildren()) do
          if Child:IsA("Hat") then
            Child:Destroy()
          end
        end
      end)
    end)
Report Abuse
Flamehead1 is not online. Flamehead1
Joined: 18 Dec 2007
Total Posts: 3406
25 Jun 2013 11:35 PM
Nope
Report Abuse
RoAnt is not online. RoAnt
Joined: 14 Jul 2008
Total Posts: 16794
25 Jun 2013 11:43 PM
"Hi guys, I'm going to wait till you give me the right script! Keep on posting."
Report Abuse
Flamehead1 is not online. Flamehead1
Joined: 18 Dec 2007
Total Posts: 3406
25 Jun 2013 11:46 PM
I said I'm learning.

[-] FʟᴀᴍᴇH1 ᴏɴ ᴛᴡɪᴛᴛᴇʀ [-]
Report Abuse
vulture97 is not online. vulture97
Joined: 09 Feb 2009
Total Posts: 1589
25 Jun 2013 11:59 PM
game.Workspace:ChildAdded(function(item)
if item.ClassName == "Hat" then
item:remove ()
elseif item.ClassName == "Model" then
e = item:getChildren ()
for i = 1,#e do
if e[i].ClassName == "Hat" then
e[i]:remove ()
end
end
end
end)
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
25 Jun 2013 11:59 PM
When do you want the hat removed?
Report Abuse
Flamehead1 is not online. Flamehead1
Joined: 18 Dec 2007
Total Posts: 3406
26 Jun 2013 12:01 AM
As the player joins

[-] FʟᴀᴍᴇH1 ᴏɴ ᴛᴡɪᴛᴛᴇʀ [-]
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
26 Jun 2013 12:02 AM
Use vulture's, his looks good.
Report Abuse
Flamehead1 is not online. Flamehead1
Joined: 18 Dec 2007
Total Posts: 3406
26 Jun 2013 12:11 AM
None of them are working.

http://www.roblox.com/Maps-place?id=120423618

[-] FʟᴀᴍᴇH1 ᴏɴ ᴛᴡɪᴛᴛᴇʀ [-]
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
26 Jun 2013 12:11 AM
No, it doesn't. . . The first line has two errors. My script probably looped and check for hats before they loaded.

    Game.Players.PlayerAdded:connect(function(Player)
      Player.CharacterAdded:connect(function(Character)
        Character:WaitForChild("Humanoid")
        Wait(5)
        for Index, Child in pairs(Character:GetChildren()) do
          if Child:IsA("Hat") then
            Child:Destroy()
          end
        end
      end)
    end)
Report Abuse
Flamehead1 is not online. Flamehead1
Joined: 18 Dec 2007
Total Posts: 3406
26 Jun 2013 12:15 AM
I got it working. Thanks to everyone that helped :)

[-] FʟᴀᴍᴇH1 ᴏɴ ᴛᴡɪᴛᴛᴇʀ [-]
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