03-21-2013, 05:03 AM
(03-21-2013, 03:17 AM)STR_Warrior Wrote:(03-14-2013, 06:42 AM)xoft Wrote: 1, Use a "for" loop, because you know the limits beforehand; a for loop is usually better optimized than a while loop. Also it's more readable.
2, Use a cBlockArea object to read the data around the player and then access it easily on a block-by-block basis. The cBlockArea should be properly documented in the Wiki
I Don't realy know how a for loop works :S i'm still a beginner with lua ;P
with the cBlockArea, i realy don't know how to use that. it has allot of features but i don't know how to make it see an area around a player and do something for every block in that area. could you give me an example maybe?
In Lua, a for loop is simply:
Code:
for i=1,10 do
-- Stuff Here
end