of     1   

ServerStorage
#128365547Tuesday, March 18, 2014 4:45 AM GMT

for i=1,4, 1 do print(i) end This prints 1,2,3,4. But I want it to print 1,2,3,4,0,-1,-2,-3,-4. How would I do this? And i don't want to make it print one by one. Like: print(1) print(2) ect...
AgentFirefox
Top 100 Poster
#128365759Tuesday, March 18, 2014 4:50 AM GMT

You'd use another loop right after it. for i = 0, -4, -1 do print(i) end 0 -1 -2 -3 -4 However, if order doesn't matter, it would be easier to do this: for i = -4, 4 do print(i) end -4 -3 -2 -1 0 1 2 3 4
ServerStorage
#128365785Tuesday, March 18, 2014 4:51 AM GMT

Print'1' Print'2' Print'3' Print'4' Print'0' Print'-1' Print'-2' Print'-3' Print'-4' like that.. I want it to be cleaner. :P for i=1,4, 1 do print(i) end this dose 1-4 but not 1 though -4. i also tried this.. for i=1,-4, 1 do print(i) end But it did not work. So idk help me? Also can you tell me how ( for i=1,4, 1 do ) works?
Sasayaki
#128365800Tuesday, March 18, 2014 4:51 AM GMT

OMG Agent changed looks!
ServerStorage
#128365808Tuesday, March 18, 2014 4:51 AM GMT

Nvm that top post thanks. :)
ServerStorage
#128366095Tuesday, March 18, 2014 4:59 AM GMT

while true do--This is for a GUI. for i = -4, 4 do script.Parent.Rotation = i wait(.3) end for i = 4, 4 do script.Parent.Rotation = i wait(.3) end end --I'm trying to make it spin back and forth... :/ --But it's like skipping back and forth. How would i fix this?
Sasayaki
#128366194Tuesday, March 18, 2014 5:01 AM GMT

Check the numbers on the 2nd loop.
AgentFirefox
Top 100 Poster
#128366219Tuesday, March 18, 2014 5:01 AM GMT

while true do--This is for a GUI. for i = -4, 4 do script.Parent.Rotation = i wait(.3) end for i = 4, -4, 1 do script.Parent.Rotation = i wait(.3) end end Do note that Rotation is in degrees. 4 degrees rotation is so small, you'll barely see it. I'd suggest at least 10 degrees.
AgentFirefox
Top 100 Poster
#128366252Tuesday, March 18, 2014 5:02 AM GMT

for i = 4, -4, -1 do script.Parent.Rotation = i wait(.3) end Forgot me negative on me step. 1 should be -1. Sorry! ~~
cntkillme
#128366265Tuesday, March 18, 2014 5:02 AM GMT

for i=1,9, 1 do print(i>5 and "-" .. i % 5 or i % 5) end
cntkillme
#128366290Tuesday, March 18, 2014 5:03 AM GMT

I really need to start reading the replies...
ServerStorage
#128366360Tuesday, March 18, 2014 5:04 AM GMT

while true do for i = -4, 4 do script.Parent.Rotation = i wait(.3) end for i = 4, -4 do script.Parent.Rotation = i wait(.3) end end --I tried this but idk how how the for i=4,-4 do thing works 100%. --Not sure how it works.. :l
Sasayaki
#128366418Tuesday, March 18, 2014 5:06 AM GMT

2nd loop should be for i = 4, -4, -1 do --Normally you need the 3rd number, which shows the increment the loop goes by. If it doesnt exist, its implied as 1. script.Parent.Rotation = i wait(.3) end
ServerStorage
#128366697Tuesday, March 18, 2014 5:12 AM GMT

Thanks

    of     1