Jump to content

remove specific player?


Speak

Recommended Posts

    players = {} 
    for k,v in ipairs(getElementsByType("player")) do 
                    players[#players+1] = v; 
        end 

how to remove a specific player?

players[#players   - 1] = v;   ? 

using - does not work

Link to comment
What? If you want to remove an specific player IN THAT table, you have two ways:

1) table.remove(players, table_index)

2) players[table_index] = nil

-- Where table_index is the position of the table that you want to remove.

I want to remove only one player

v = ...

?

players[v_index] = nil

?

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...