|
| 11 Dec 2015 07:46 PM |
| Can someone tell me how to make a script that adds players in the game to a table? |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2015 07:48 PM |
for i,v in ipairs(game.Players:GetChildren()) do
-- i for the index meaning number of items in the players folder -- v for the actual player
end |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2015 07:48 PM |
I tried:
PlayerZ = {} -- WORKS
function Added() for i,v in pairs(game.Workspace:GetChildren()) do if v:FindFirstChild("Humanoid") then table.insert(PlayerZ,v) end print(PlayerZ[i]) end end
Added() |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2015 07:51 PM |
PlayerZ = {} -- WORKS
function Added() for i,v in pairs(game.Players:GetChildren()) do
table.insert(PlayerZ,v[i]) -- I think this should go down 1 by 1 since its v[i]
end print(PlayerZ[i]) end
end
Added() |
|
|
| Report Abuse |
|
|
| |
|