I made a script so that with random numbers generated, the block (an ore) changes materials and such. But they all wind up exactly the same. If one block was selected as "Copper", the rest are coppers.
Can anyone help me fix the script without having to change the variable m=math.random
math.randomseed(tick())
local m=math.random(1,1000)
if m > 0 and m < 400 then
script.Parent.BrickColor=BrickColor.new("Dirt brown")
script.Parent.Material="Concrete"
script.Parent.BlockValue="Dirt"
end
if m > 400 and m < 600 then
script.Parent.BrickColor=BrickColor.new("Rust")
script.Parent.Material="Ice"
script.Parent.BlockValue="Copper"
end
if m > 600 and m < 750 then
script.Parent.BrickColor=BrickColor.new("Institutional white")
script.Parent.Material="Ice"
script.Parent.BlockValue="Silver"
end
if m > 750 and m < 900 then
script.Parent.BrickColor=BrickColor.new("CGA brown")
script.Parent.Material="Slate"
script.Parent.BlockValue="Iron"
end
if m > 900 and m < 950 then
script.Parent.BrickColor=BrickColor.new("New Yeller")
script.Parent.Material="Ice"
script.Parent.BlockValue="Gold"
end
if m > 950 and m < 975 then
script.Parent.BrickColor=BrickColor.new("Pastel Blue")
script.Parent.Material="Ice"
script.Parent.BlockValue="Diamond"
end
if m > 975 and m < 985 then
script.Parent.BrickColor=BrickColor.new("Eggplant")
script.Parent.Material="Granite"
script.Parent.BlockValue="Obsidian"
end
if m > 985 and m < 990 then
t=Instance.new("PointLight")
script.Parent.BrickColor=BrickColor.new("Really red")
script.Parent.Material="Cobblestone"
script.Parent.BlockValue="Adurite"
t.Parent=script.Parent
t.Brightness=5
t.Color=Color3.new(255,0,0)
t.Range=10
end
if m > 990 and m < 995 then
a=Instance.new("PointLight")
script.Parent.BrickColor=BrickColor.new("Forest green")
script.Parent.Material="Pebble"
script.Parent.BlockValue="Viridian"
a.Parent=script.Parent
a.Brightness=5
a.Color=Color3.new(85,170,0)
a.Range=10
end
if m > 995 and m < 999 then
g=Instance.new("PointLight")
h=Instance.new("Fire")
script.Parent.BrickColor=BrickColor.new("Dark blue")
script.Parent.Material="Foil"
script.Parent.BlockValue="Bluesteel"
g.Parent=script.Parent
g.Brightness=5
g.Color=Color3.new(0,0,255)
g.Range=10
h.Parent=script.Parent
h.Heat=3
h.Color=Color3.new(0,0,255)
h.SecondaryColor=Color3.new(0,0,255)
h.Size=13
end
if m > 999 and m < 1001 then
k=Instance.new("Sparkles")
script.Parent.BrickColor=BrickColor.new("Black")
script.Parent.Material="Cobblestone"
script.Parent.BlockValue="Black Iron"
k.Color=Color3.new(85,0,255)
end

2 comments
oops i made a mistake just copy the script underneath the 3rd paragraph and run it
This does NOT answer my question at all. You didn't even include math.randomseed(tick()) which makes truly random numbers. Please explain properly.