|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 22 Apr 2017 01:04 AM |
ill tell you if it works
tytyty |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2017 01:07 AM |
didnt work any others that I can try?
tytyty |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|