I have a local script that's in a tool, and when you click it, it's supposed to make your character change into one of the materials from an array, but it only works once and won't change anything afterwards. I've been changing things for half an hour and haven't come up with any ideas as to what's wrong with it.
char = game.Players.LocalPlayer.Character:GetChildren()
tool = script.Parent
materials = {"Grass","Wood","Neon"}
m = materials[math.random(#materials)]
tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
for i,v in pairs(char) do
if v:IsA("Part") then
v.Material = m
end
end
end)
end)

1 comment
Thanks, it worked. I feel like such a idiot .-. lol, one day i'll be better at this