Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Xadrez:getPiecesOnTab()
- local black, white = {}, {}
- for x = 0, 7 do
- for y = 0, 7 do
- pos.x, pos.y, pos.z = INITIAL_POS.x, INITIAL_POS.y, INITIAL_POS.z
- pos.x, pos.y = pos.x + x, pos.y + y
- local creature = getTopCreature(pos)
- if(isCreature(creature.uid) and (not isPlayer(creature.uid)))then
- local name = getCreatureName(creature.uid)
- if(self:isPiece(name))then
- table.insert((name:find("black") and black or white), creature.uid)
- end
- end
- end
- end
- return black, white
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement