How do i make all player's accessories massless?

currently, this is my (mostly from other people) code that doesnt work

for _,v in pairs(char:GetChildren()) do
	if v:IsA("Accessory")then
		print(v)
		for _,x in pairs(v:GetChildren()) do
			print(x)
			if x:IsA("Part") then
				x.Massless = true
			end
		end
	end
end

any suggestions?

1 Like

Does this work? put it in a ServerScript inside ServerScriptService

game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		for _,v in pairs(char:GetChildren()) do
	if v:IsA("Accessory")then
		--print(v)
		for _,x in pairs(v:GetChildren()) do
			--print(x)
					if x:IsA("Part") or x:IsA("MeshPart") or x:IsA("BasePart")then
				x.Massless = true
			end
		end
	end
	end
	end)
	
	
end)

1 Like