Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to Remove Accessories properly?

Hello my script in removing accessories in a character doesn't work. The error doesn't pop-up in the output.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		repeat wait()until character
		character.Humanoid:RemoveAccessories()
	end)
end)

2 comments

0

why are you using a repeat loop if you have the CharacterAdded event

0

Oh i tested to see if it works if i put a loop on but it doesn't.

1 answer

I personally do it this way, not sure if there's any other way.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:connect(function(char)

		for _,v in pairs(char:GetChildren()) do
			if v.ClassName == 'Accessory' then
				v:Destroy()
			end
		end
	end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.