12p Posted December 23, 2010 Share Posted December 23, 2010 I don't know how to do this easier... I have made this but isn't working as I want: local intX,decX = math.modf(posX) local intY,decY = math.modf(posY) if decX >= -0.6 then if decY >= -0.6 then block = createObject (model,intX,intY,posZ+0.5) table.insert(blocks,block) setElementID (block,tostring(table.getn(blocks)+1)) addObjectToMap(block) elseif decY < -0.6 then block = createObject (model,intX,intY+1,posZ+0.5) table.insert(blocks,block) setElementID (block,tostring(table.getn(blocks)+1)) addObjectToMap(block) end elseif decX < -0.6 then if decY >= -0.6 then block = createObject (model,intX+1,intY,posZ+0.5) table.insert(blocks,block) setElementID (block,tostring(table.getn(blocks)+1)) addObjectToMap(block) elseif decY < -0.6 then block = createObject (model,intX+1,intY+1,posZ+0.5) table.insert(blocks,block) setElementID (block,tostring(table.getn(blocks)+1)) addObjectToMap(block) end end Link to comment
Aibo Posted December 23, 2010 Share Posted December 23, 2010 http://lua-users.org/wiki/SimpleRound no? Link to comment
12p Posted December 23, 2010 Author Share Posted December 23, 2010 F^^K Yeah! Thanks again Aiboforcen Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now