Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

how would i record if a player died in a game round or not?

Asked by 7 years ago
Edited 7 years ago

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.

0
There's a Died event to humanoids. M39a9am3R 3210 — 7y
0
@M39a9am3R thanks, i'll look into that. IfIWasntSoSwag 98 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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

-- example
bool = false

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(chr)
        function roundstart()
            if bool == false then
                bool = true
            end
            wait(90) -- 1.5 mins
            -- do whatever else
        end

        function roundend()
            if bool == true then
                bool = false
            end
            wait(30)
            -- do whatever else
        end

        for i=1, math.huge() do
            roundstart()
            wait()
            roundend()
        end

        chr.Humanoid.Died:connect(function(player)
            if bool == true then
                ('ey')
            end
        end)
    end)
end)


  • I kinda just wrote that on ze fly so it may be incorrect in some parts
0
if u need to do something to verify whether they r in the match use a 'ready for match' gui and a bool value (object not made in the script) in the player in players which is true if they click ready for match. - bools save the day. - remember to use bools to debug fam. MrDefaultMan 113 — 7y
Ad
Log in to vote
0
Answered by
JuanCema -10
7 years ago

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.

0
alright IfIWasntSoSwag 98 — 7y

Answer this question