of     1   

SmokoSmoko
#174117806Monday, September 14, 2015 7:28 AM GMT

So I am making a minigame place and one of the minigames work like this, every 15 seconds a random player dies and that continues until there is one last person standing. Or, I want to know how to make it continue until there is one last player standing. I know a little about iteration and loops and I'm pretty sure that's what I need to know, but I'm not sure HOW to do it. Like, do I need to add each and every player to a table and remove them when they die? From an ambitious and new scripter, SmokoSmoko
SmokoSmoko
#174118484Monday, September 14, 2015 8:11 AM GMT

0.0 No replies just yet...
Quadrius
#174120123Monday, September 14, 2015 10:06 AM GMT

..You literally just explained it? XD When you start the mini game, add all of the players to a table. Once a player dies, remove them from said table. Quite simple.
prepareds
#174123084Monday, September 14, 2015 12:28 PM GMT

put a value inside all players and check for values repeatedly???
Reprediction
#174123138Monday, September 14, 2015 12:30 PM GMT

whiile wait() do for i, v in pairs(game.Players:GetPlayers()) do if not v.isStanding.Value then print("No players are standing") end end end
FrankieTheDino
#174123400Monday, September 14, 2015 12:40 PM GMT

I would make a table and put all player's name in. After that, when someone dies, remove the name from the list. When the list count is less then 2 and if it is equal to 1 then announce the winner. Otherwise, it would be a tie... unless you don't want a tie :P
SmokoSmoko
#174143311Monday, September 14, 2015 8:15 PM GMT

Ahhh, I see the answer was in the question :D Thanks guys.
SlurpeguyV2
#182658840Saturday, January 30, 2016 5:00 AM GMT

[ Content Deleted ]
cofunction
#182660860Saturday, January 30, 2016 5:43 AM GMT

@SlurpguyV2 local names = {} for _, player in pairs (game.Players:GetChildren()) do if player then table.insert(names, player.Name) end end for name in ipairs (names) do print(name) end #Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217")
SmokoSmoko
#182663117Saturday, January 30, 2016 6:58 AM GMT

since when was this necrobumped

    of     1