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: Very Simple Script Help!

Previous Thread :: Next Thread 
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
21 May 2014 08:49 PM
This part of the script is suppose to remove the players hats it doesn't work can some one fix it?


for _,v in pairs(Player.Character:GetChildren()) do
if v.ClassName == "Hat" then
v:Destroy()
Report Abuse
Azeroth17 is not online. Azeroth17
Joined: 13 May 2014
Total Posts: 86
21 May 2014 08:53 PM
for i,v in pairs(game.Players:GetPlayers()) do
if v.Character then
for a,b in pairs(v.Character:GetChildren()) do
if b.ClassName == "Hat" then
b:Destroy()
end
end
end
end
Report Abuse
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
21 May 2014 08:58 PM
Okay this is part of the script it's in a text button once the players clicks it the hats remove ohhhhhhhhh myyyy goooooodddddddddddd I should just go find a hat removing gui button mothhhhhhhhhhhherrrrrderper
Report Abuse
Azeroth17 is not online. Azeroth17
Joined: 13 May 2014
Total Posts: 86
21 May 2014 09:03 PM
put this in a localscript inside the button


pl = game.Players.LocalPlayer

script.Parent.MouseButton1Down:connect(function()
if pl.Character then
for i,v in pairs(pl.Character:GetChildren()) do
if v.ClassName == "Hat" then
v:Destroy()
end
end
end
end
Report Abuse
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
21 May 2014 09:05 PM
I got it figured out thanks for the helps doh.
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