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: Accessory remover help

Previous Thread :: Next Thread 
UndeadBarrier is online. UndeadBarrier
Joined: 24 Oct 2010
Total Posts: 129
22 Apr 2017 12:48 AM
so i keep on doing things like:

game.Workspace.ChildAdded:connect(function(child)
if child:IsA("Hat") then
child:Destroy()
end
end)


or something like:
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr)
for _,v in pairs(chr:GetChildren()) do
if v:IsA("Hat") then
v:Destroy()
end
end
end)

none of these are working for some reason any help?



tytyty
Report Abuse
PhantomVisual is not online. PhantomVisual
Joined: 08 Apr 2011
Total Posts: 2025
22 Apr 2017 12:52 AM
The 'Hat' Class doesn't exist anymore. It changed to 'Accessory'. Here are some simplified versions:

game.Workspace.ChildAdded:connect(function(c)
if c.ClassName == 'Accessory' then
if c.Parent = workspace then
c:Destroy()
end
end
end)

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr)
chr:WaitForChild('Humanoid'):RemoveAccessories()
end
plr:LoadCharacter()
end)


Report Abuse
Rice_Nice is not online. Rice_Nice
Joined: 12 Mar 2017
Total Posts: 166
22 Apr 2017 12:55 AM
Check for 'Accessory' objects in player's characters too. Might also be worth waiting until player:HasAppearanceLoaded() returns true.
Report Abuse
UndeadBarrier is online. UndeadBarrier
Joined: 24 Oct 2010
Total Posts: 129
22 Apr 2017 01:04 AM
ill tell you if it works



tytyty
Report Abuse
UndeadBarrier is online. UndeadBarrier
Joined: 24 Oct 2010
Total Posts: 129
22 Apr 2017 01:07 AM
didnt work any others that I can try?


tytyty
Report Abuse
sidekick601 is not online. sidekick601
Joined: 27 Feb 2012
Total Posts: 8734
22 Apr 2017 01:52 AM
i had a similar problem earlier, try this

game.Players.PlayerAdded:connect(function(player)
if player and player.Character then
for _, v in pairs (player.Character:GetChildren()) do
if v:IsA("Accessory") then
v:Destroy()
end
end
end
end)

did this raw so check if im missing an end or somethin lol
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