Guest User

Untitled

a guest
Jun 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. function checkJoiners()
  2.     local checker = true
  3.     local players = {}
  4.     local vocations = {false,false,false,false}
  5.     for i = 1, #standing_positions do
  6.         local cid = getTopCreature(standing_positions[i]).uid
  7.         if cid > 0 then
  8.             if getPlayerStorageValue(cid,player_quest) < 2 then
  9.                 table.insert(players,cid)
  10.             end
  11.         end
  12.         local number = isKnight(cid) and 4 or isPaladin(cid) and 3 or isDruid(cid) and 2 or isSorcerer(cid) and 1 or 5
  13.         vocations[number] = true
  14.     end
  15.     if #players < 4 then
  16.         checker = false
  17.     end
  18.     for _, found in ipairs(vocations) do
  19.         if not found then
  20.             checker = false
  21.             break
  22.         end
  23.     end
  24.  
  25.     return checker and players or false
  26. end
Add Comment
Please, Sign In to add comment