I'm making some game that requires 20 or so NPCs to spawn with different skin colors and stuff (I have a single NPC in ReplicatedStorage) so i made a Folder in Workspace with the BodyColors in it (7 of them), so i can access them easily from my script
The script i made is supposed to Clone the NPC Set the parent of the NPC to workspace and change it's skin color, so i used this script here
for i = 1,20 do
local Color = game.Workspace.BodyTypes["Body".. math.random(1,7)]:Clone()
local NPC = game.ReplicatedStorage.NPC:Clone()
Color.Parent = NPC
NPC.Parent = game.Workspace
end
so i intended it to access the Folder (BodyTypes) and grab a random BodyColors out of it and i did that with a math.Random so if it chose 1 it would be Body1 if it chose 2 it would be Body2 etc. but when i test the game the math.Random chooses the same body color every time apart from the first clone, so all the npcs look the same, i don't know why this is happening, any help? (Also the NPC goes into the workspace and BodyColors goes into the NPC, but they all end up the same apart from 1)

2 comments
Though sometimes the npcs have the same skin color.
I would do that but i have just fixed it, thanks anyways