AelerityJoin Date: 2011-07-20 Post Count: 4271 |
wait (5)
if 1 then script.Parent.BrickColor = BrickColor.new == "Really red"
if 2 then script.Parent.BrickColor = BrickColor.new == "Really blue"
if 3 then script.Parent.BrickColor = BrickColor.new == "New Yeller"
if 4 then script.Parent.BrickColor = BrickColor.new == "Hot pink"
if 5 then script.Parent.BrickColor = BrickColor.new == "Lime green"
end
while true do
wait (.25)
math.random(1,5)
end
end
end
end
end
This doesn't work.
Basically what I want is after 5 seconds the script picks a random number between 1 and 5 every .25 seconds and the brick becomes that color. And it does this forever. But it doesn't work.
"There's candy in the white van kids!" |
|
|
while true do
wait(5)
local rand = math.random(1,5)
if rand == 1 then script.Parent.BrickColor = BrickColor.new == "Really red"
if rand == 2 then script.Parent.BrickColor = BrickColor.new == "Really blue"
if rand == 3 then script.Parent.BrickColor = BrickColor.new == "New Yeller"
if rand == 4 then script.Parent.BrickColor = BrickColor.new == "Hot pink"
if rand == 5 then script.Parent.BrickColor = BrickColor.new == "Lime green"
end
end
end
end
end
end |
|
AelerityJoin Date: 2011-07-20 Post Count: 4271 |
Everytime i do your script it crashes :/
"There's candy in the white van kids!" |
|
|
|
you tried to make a boolean with the brick color... it works fine on a baseplate, tried it myself, heres the new script, just put the script into a brick...
while true do
wait(5)
local rand = math.random(1,5)
if rand == 1 then script.Parent.BrickColor = BrickColor.new("Really Red")
if rand == 2 then script.Parent.BrickColor = BrickColor.new("Really blue")
if rand == 3 then script.Parent.BrickColor = BrickColor.new("New Yeller")
if rand == 4 then script.Parent.BrickColor = BrickColor.new( "Hot pink")
if rand == 5 then script.Parent.BrickColor = BrickColor.new("Lime green")
end
end
end
end
end
end |
|
|
wait (5)
if 1 then script.Parent.BrickColor = BrickColor.new == "Really red"
if 2 then script.Parent.BrickColor = BrickColor.new == "Really blue"
if 3 then script.Parent.BrickColor = BrickColor.new == "New yeller"
if 4 then script.Parent.BrickColor = BrickColor.new == "Hot pink"
if 5 then script.Parent.BrickColor = BrickColor.new == "Lime green"
end
while true do
wait (.25)
math.random(1,5)
end
end
end
end
end
-- of course you capitalized them wrong too... |
|
|
^^ New Yeller* (my keyboard has an autocorrect function app thingy ) |
|
KEVEKEV77Join Date: 2009-03-12 Post Count: 6961 |
no.
while true do
local ran = math.random(1,5)
wait (5)
if ran == 1 then script.Parent.BrickColor = BrickColor.new("Really red")
end
if if ran == 2 then script.Parent.BrickColor = BrickColor.new("Really blue")
end
if ran == 3 then script.Parent.BrickColor = BrickColor.new("New yeller")
end
if ran == 4 then script.Parent.BrickColor = BrickColor.new("Hot pink")
end
if ran == 5 then script.Parent.BrickColor = BrickColor.new("Lime green")
end
end
|
|
|
This is what I did:
while true do
wait(1)
local rand = math.random(1,5)
print(rand)
if rand == 1 then script.Parent.BrickColor = BrickColor.new(21)
elseif rand == 2 then script.Parent.BrickColor = BrickColor.new(1010)
elseif rand == 3 then script.Parent.BrickColor = BrickColor.new(1009)
elseif rand == 4 then script.Parent.BrickColor = BrickColor.new(1032)
elseif rand == 5 then script.Parent.BrickColor = BrickColor.new(1020)
else
print("Error")
end
end
|
|
lupineJoin Date: 2008-06-24 Post Count: 3561 |
colors = {21,1010,1009,1032,1020}
while wait(1) do
local r = colors[math.random(1,#colors)]
script.Parent.BrickColor = BrickColor.new(r)
end
That should do it. |
|
|
The original script used BrickColor.new == " "
I used Brickcolor.new(0)
I reverted to color codes after the script kept failing to run, even though it was printing out the correct numbers. |
|
|
@Lup
That's the RIGHT way to do it! |
|
AelerityJoin Date: 2011-07-20 Post Count: 4271 |
ok thanks guys for your help!
"There's candy in the white van kids!" |
|