Professional Documents
Culture Documents
Enemyalert Iter
Enemyalert Iter
-----------------------------------------------------------------------------------
--------------
-----------------------------------------------------------------------------------
--------------
-----------------------------------------------------------------------------------
--------------
--this continuously loops, executing the code inside over and over again
while (true) do
--this loops over every player on screen
for name, player in Creature.iPlayers() do
--this checks if the player is an enemy
if (table.contains(enemies, name)) then
alert()
break --break exits the inner-most loop
end
end