Hair Randomizer

I’m trying to make a game with random character designs, and I need help making a randomized hair.

For some reason, my script isn’t working. But there are no errors in the output, there’s also a file in ReplicatedStorage named Accessories.

Acces

I also tried adding Player.PlayerAdded but it still doesn’t seem to work. I also don’t know much about math.random so the error could be that.

Chosen is true no matter whether its true or false.
The for loop isn’t needed and you didn’t use to choose a hair

You can just do:

RandomHair = Accesories:GetChildren()[math.random(1, #Accesories:GetChildren())]
if Random Hair then
-- do a thing
end

Hope this helps

I can’t figure out how to debug the last bracket. There was an error every time I tried to debug it.

What was the error? ____________

The error was
Test

i edited it, retry _____________