I have made a dropper that drops ores, but i want the ores to be dropping with different colours, like first ore - red, second ore - purple, third ore - red, fourth ore - purple ect. when i tried putting something like this :
if(col == 1) then
part.BrickColor = BrickColor.new("Really red")
col = 0
finish = 1
end
if(finish == 0) then
if(col == 0) then
part.BrickColor = BrickColor.new("Royal purple")
col = 1
end
end
finish = 0
There is a pattern for the colours, not random. in the droppers script, it just drops red coloured parts, where is the mistake i make??
Full Code:
while wait(1.75) do
local col = 1
local finish = 0
local part = Instance.new("Part",game.Workspace)
part.Name = "Ore"
part.Size = Vector3.new(0.5, 0.5, 0.5)
part.BottomSurface = 0
part.TopSurface = 0
part.Position = script.Parent.Position - Vector3.new(0, -0.5, 0)
if(col == 1) then
part.BrickColor = BrickColor.new("Really red")
col = 0
finish = 1
end
if(finish == 0) then
if(col == 0) then
part.BrickColor = BrickColor.new("Royal purple")
col = 1
end
end
finish = 0
end
local cash = Instance.new("NumberValue",part)
cash.Name = "Cash"
cash.Value = 100000000

4 comments
Can you please put this in a code block so it can be easily understood. When writing the question, there is a blue Lua button, click it and insert your code there.
And are you trying to make it random colours, or a set colour pattern?
done!
Use BrickColor.Random() if you're wanting random colors.