of     1   

ash877
#139450556Sunday, July 06, 2014 8:20 PM GMT

example: table={} --I now insert all players from playerlist into the table players=game.Players:GetChildren() for i=1,#players do table.insert(table,players[i]) end --How do I get any player's index position in the table so that I can be able to remove them. table.remove(table,game.Players.ash877)--I don't know what to do. table.remove will only work with positions not values like table.insert(table,game.Players.ash877) how do i get the player position/preferably without using for i,v in pairs
ash877
#139451067Sunday, July 06, 2014 8:25 PM GMT

any help?
ScottRhode
#139451272Sunday, July 06, 2014 8:27 PM GMT

i see no other way than i,v in pairs, well, in ipairs. for i,v in ipairs(table) do if table[i] == player --make something to define player first then table.remove(table,i) end
Funse
#139451335Sunday, July 06, 2014 8:27 PM GMT

You mean like this? for i,v in pairs(table) do if v == game.Players.Ash877 do table.remove(v) (Or table.remove(I). try both) end end
Sacrificable
#139451802Sunday, July 06, 2014 8:32 PM GMT

Easy, for 1 you don't haft to do table.insert you can just do players = game.Players:GetChildren() and players will be the table with all of the players. Then to find out the place of a certain player in the table... place = 0 for i = 1, #players do --Or if you need the place of each player just use local place = 0 then put the code you need for each player in the for loop.... if players[i].Name == "SpecialPlayerYouNeedPlaceFrom" then place = i end end
ash877
#139453232Sunday, July 06, 2014 8:45 PM GMT

i'll try ohno's way
ash877
#139456944Sunday, July 06, 2014 9:20 PM GMT

it worked. thanks :D

    of     1