local bcr = math.random(1,3)
if bcr == 1 then
game.ServerStorage.Assets.Character.BodyColor1:Clone().Parent = script.Parent
elseif bcr == 2 then
game.ServerStorage.Assets.Character.BodyColor2:Clone().Parent = script.Parent
elseif bcr == 3 then
game.ServerStorage.Assets.Character.BodyColor3:Clone().Parent = script.Parent
end
But, its not worked. I want random body color system.
If this a local script, then it cant reach ServerStorage (i dont think this is local script). Also try this:
local function GetColor()
local Colors = {}
for _, Color : BodyColors in pairs(game:GetService("ServerStorage").Assets.Character:GetChildren()) do
if Color:IsA("BodyColors") then
table.insert(Colors, Color)
end
end
local Roll = tostring(math.random(1,#Colors))
for _, Color : BodyColors in pairs(Colors) do
if string.split(Color.Name, "BodyColor")[2] == Roll then
return Color
end
end
end
local Clone = GetColor():Clone()
Clone.Parent = script.Parent
Tested it in my workspace, it worked (i created your environment)