|
| 30 Apr 2017 08:47 AM |
Say like there are 4 players,the last person standing wins. How do I make that?
ok |
|
|
| Report Abuse |
|
|
Rice_Nice
|
  |
| Joined: 12 Mar 2017 |
| Total Posts: 166 |
|
|
| 30 Apr 2017 08:51 AM |
| Make a table holding the names of the players in the round. Then use the Humanoid.Died event to first remove the corresponding player from the table, and second check if only one player is still standing (length of that table == 1). |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2017 08:59 AM |
to hold their names i have to make a for loop right?
ok |
|
|
| Report Abuse |
|
|
Thedagz
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 798 |
|
|
| 30 Apr 2017 10:18 AM |
local PlayersTable = {}
game.Players.PlayerAdded:Connect(function(Player) PlayersTable[#PlayersTable + 1] = Player Player.CharacterAdded:Connect(function(Character) Character:WaitForChild("Humanoid").Died:Connect(function() -- Remove from table then check the length of the table if it equals 1 end end) end)
game.Players.PlayerRemoving:Connect(function(Player) for i = 1,#PlayersTable do if PlayersTable[i] == Player then table.remove(PlayersTable,i) break end end end)
|
|
|
| Report Abuse |
|
|
|
| 30 Apr 2017 10:35 AM |
Thanks! I'll try this out.
ok |
|
|
| Report Abuse |
|
|
| |
|
Rice_Nice
|
  |
| Joined: 12 Mar 2017 |
| Total Posts: 166 |
|
| |
|
|
| 01 May 2017 06:04 AM |
everything :(((((((((((((((((((
ok |
|
|
| Report Abuse |
|
|