how would i record if a player died in a game round or not? i've lost my attempt to this due to studio issues.
Make a bool that sets to true when the round has started then use the plr.Humanoid.died() function. Once the player dies say if bool == true then to confirm a round is in session.
Wiki: http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Died
01 | -- example |
02 | bool = false |
03 |
04 | game.Players.PlayerAdded:connect( function (plr) |
05 | plr.CharacterAdded:connect( function (chr) |
06 | function roundstart() |
07 | if bool = = false then |
08 | bool = true |
09 | end |
10 | wait( 90 ) -- 1.5 mins |
11 | -- do whatever else |
12 | end |
13 |
14 | function roundend() |
15 | if bool = = true then |
What I would do is insert something into the player, such as a value. Once the players health => 0, then you make the value 1 or something. Check at the end of the game everyone's tags. If you a player has a 2 value, then the were still alive. If the value is 1, then they died. Just a suggestion, but I'm looking into it.