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

How does someone Restart a game after someone dies?

Asked by 6 years ago

I'm making a fighting game and I want there to be a new round to restart after someone dies.

1 answer

Log in to vote
0
Answered by 6 years ago

I cannot really help you with the lack of detail in your request, but I can at least try.

game.Players.PlayerAdded:connect(function(p)
    p.CharacterAdded:connect(function(c)
        if c:WaitForChild("Humanoid"):GetState() ==Enum.HumanoidStateType.Dead then
            print("Dead")

        end
    end)
end)

In this code, we run off of the PlayerAdded event. The parameter "p" is the player. Skipping a line, we check to see if the Humanoid's state is "Dead". If true, then the server prints "Dead" to output.

Again, I can't really help you without seeing what you are trying to do exactly, but I hope this helped a bit!

Ad

Answer this question