of     1   

Thane_1
#208215327Wednesday, January 25, 2017 10:53 PM GMT

I found this line of code online regarding Perlin Noise, and I've never used C, but I was able to convert it a little. --Before: for (int y = 0; y < height; y++) { } --After: for (y = 0, y < height, y++) do end --I'm guessing the 'y < height' is an if statement, and 'y++' is the increment? Can someone help? I might just have to use a repeat loop. ~Who's awesome? You're awesome!
Unsubtleties
#208215428Wednesday, January 25, 2017 10:55 PM GMT

for y = 0, height, 1 do -- code end 0 is the starting point, height is the maximum value, and 1 is the increment http://wiki.roblox.com/?title=Loops
SenseiWarrior
#208215451Wednesday, January 25, 2017 10:55 PM GMT

in lua u start with 1 instead of 0 also tables start at index 1 not 0 3rd argument is the increment (can be decimal) for i = 1, height, 1 do print(i) end Downgrading STF // https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=6163444
Unsubtleties
#208215482Wednesday, January 25, 2017 10:56 PM GMT

it's also worth noting that the increment is set to 1 by default so it's redundant in that example
Unsubtleties
#208215537Wednesday, January 25, 2017 10:56 PM GMT

"in lua u start with 1 instead of 0" what are you talking about? we're using loops here, not arrays
SenseiWarrior
#208215692Wednesday, January 25, 2017 10:59 PM GMT

in java/c/c++ u start at 0 like this for(int i = 0, i < endValue, i++) { } Downgrading STF // https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=6163444
Unsubtleties
#208215722Wednesday, January 25, 2017 10:59 PM GMT

okay...? what's different in lua?
Thane_1
#208215769Wednesday, January 25, 2017 11:00 PM GMT

Thanks, I didn't realize it was so simple. ~Who's awesome? You're awesome!
SenseiWarrior
#208215782Wednesday, January 25, 2017 11:00 PM GMT

i starts at 1 not 0 can u read u idiot Downgrading STF // https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=6163444
Unsubtleties
#208215845Wednesday, January 25, 2017 11:01 PM GMT

i'm not the idiot here, for some reason you seem to think that for loops in lua need to have a starting value of 1 you don't belong here to help if you don't even know what you're talking about
SenseiWarrior
#208215898Wednesday, January 25, 2017 11:02 PM GMT

they normally start at 1 if you dont need to use i Downgrading STF // https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=6163444
Thane_1
#208215930Wednesday, January 25, 2017 11:02 PM GMT

lol, no need to insult people. Also, it has to start at 0, and I just tested in studio, and a for loop can start from 0. ~Who's awesome? You're awesome!
SenseiWarrior
#208215987Wednesday, January 25, 2017 11:03 PM GMT

they can start at whatever but if you just wanna loop for a fixed amount of times you dont need to set i to anything other than 1 Downgrading STF // https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=6163444
SenseiWarrior
#208216045Wednesday, January 25, 2017 11:04 PM GMT

if you wanna loop for 10 times u do this for i = 1, 10 do end because this loops for 11 times for i = 0, 10 do end Downgrading STF // https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=6163444
Unsubtleties
#208216087Wednesday, January 25, 2017 11:04 PM GMT

"in lua u start with 1 instead of 0" do you not remember saying that? for loops don't have a specific starting value
Unsubtleties
#208216117Wednesday, January 25, 2017 11:05 PM GMT

yes, i'm aware of that, but that's not what you said at first
Scriptural
#208219067Wednesday, January 25, 2017 11:41 PM GMT

for x = -100, 0, 1 do print("Loops can start at ### ######### end

    of     1