So this script is for a hair removal, if you click a tool your hair will be removed but in this case it didnt work, it kept saying y must be a nil value. Here's the script.
for i=1, #y do
if (y[i].ClassName == "Accoutrement") then
y[i]:remove()
end
end
Please help, :( i would very appreciate it! ;-;

2 comments
Whatever the error was, it wasn't "y must be a nil value"; more likely, "y is a nil value" when it shouldn't be. If it was erroring on the 'for i = 1, #y do' line, then the problem is that #y doesn't exist because 'y' isn't a table. We need to see how you assign to 'y'.
Could you post the whole code please? Also, just a quick tip - use Destroy() instead of remove() :)