Guest User

Untitled

a guest
Jul 9th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. grid = {} --51 per 32
  2. for i = 0, 51 do
  3. grid[i] = {}
  4. end
  5.  
  6. function reset()
  7. for i = 0, 51 do
  8. for e = 0, 32 do
  9. grid[i][e] = 0
  10. end
  11. end
  12. end
  13.  
  14. function check()
  15. reset()
  16. tpt.start_getPartIndex()
  17. while tpt.next_getPartIndex() do
  18. local index = tpt.getPartIndex()
  19. if tpt.get_property("type", index) == 18 then
  20. grid[math.floor(tpt.get_property("x", index) / 51)][math.floor(tpt.get_property("y", index) / 32)] = grid[math.floor(tpt.get_property("x", index) / 51)][math.floor(tpt.get_property("y", index) / 32)] + 1 --I hate this line
  21. end
  22. end
  23. tpt.drawtext(20, 30, "Rad "..tostring(grid[math.floor(tpt.mousex / 51)][math.floor(tpt.mousey / 32)]))
  24.  
  25. end
  26.  
  27. tpt.register_step(check)
Advertisement
Add Comment
Please, Sign In to add comment