Quote
if xr == "run" then
print("The process will start in 5 seconds")
sleep(5)
print("Pulsing White")
rs.setBundledOutput("back", colors.white)
sleep(3)
rs.setBundledOutput("back", 0)
end
So i was wondering how do i make this repeate
Posted 19 October 2012 - 11:22 PM
Quote
Posted 19 October 2012 - 11:29 PM
xr = "run"
while xr == "run" do
print("The process will start in 5 seconds")
sleep(5)
print("Pulsing White")
rs.setBundledOutput("back", colors.white)
sleep(3)
rs.setBundledOutput("back", 0)
end
Posted 20 October 2012 - 02:01 AM
while true do
print("The process will start in 5 seconds")
sleep(5)
print("Pulsing White")
rs.setBundledOutput("back", colors.white)
sleep(3)
rs.setBundledOutput("back", 0)
end
print("The process will start in 5 seconds")
sleep(5)
print("Pulsing White")
while true do
rs.setBundledOutput("back", colors.white)
sleep(3)
rs.setBundledOutput("back", 0)
end
print("The process will start in 5 seconds")
sleep(5)
print("Pulsing White")
while true do
sleep(1.5)
rs.setBundledOutput("back", colors.white)
sleep(1.5)
rs.setBundledOutput("back", 0)
end
Posted 20 October 2012 - 02:55 AM
if xr == "run" then
print("The process will start in 5 seconds")
sleep(5)
print("Pulsing White")
for i = 1, 5 do
rs.setBundledOutput("back", colors.white)
sleep(3)
rs.setBundledOutput("back", 0)
end
end
The "i" variable is local only to that code block, you can name it whatever you like, "i" is the most common. You can even have multiple for i = 1, x do code blocks in the same code. It also accepts variables, like if you wanted to request an amount of iterations. Like the one above. It works if x is global, and set to a number. My personal favorite loop.
Posted 20 October 2012 - 08:00 AM
0 members, 1 guests, 0 anonymous users