Jump to content

array problem


Kenix

Recommended Posts

please help does not work on a script idea he must choose one player, but when the server is greater than 2 players, he begins to select all or choose all but one player. :(

  
  
  
  
function playerzmtake () 
 local array = {} 
     for i,pl in ipairs(getElementsByType("player")) do 
          array[i]=pl 
     end 
     if #array>0 then 
          local c = 0 
          while true do  
               c=math.random(1,#array)  
               if array[c]~=nil then break end 
          end 
          setPlayerTeam" class="kw6">setPlayerTeam (array[c], teamzombie ) 
          array[c]=nil 
end 
end 
  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...