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

How can I make it so this script targets it's Name instead of ClassName?

I want this script to target anything that is named "Accessory2" instead of it's ClassName "Accessory", how would I change the script to do so?

local variable = script.Parent:WaitForChild("ClickDetector") variable.MouseClick:Connect(function(p) if p.Character then for _,v in next,p.Character:GetChildren() do if v:Is("Accessory") then v.Part2.Mesh.VertexColor = Vector3.new(0, 0, 0) end end end end)

1 answer

✓ Accepted answer

Just change it to v.Name == "Accessory2"

1 comment

0

Works great, thank you!

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