Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How To Reanimate a player?

Ok Guys I'm Trying To Make Like A Left 4 Dead 2 Game, But I Only i want to ask is how you can make a reanimate player, like if the player have health in 0, The player will stay down on the floor , and he have a countdown, if the countdown finish the player will die.

But he can be saved by a player, if you keep the e prized you can reanimate it.

If You Don't know what i'm saying. Send me a message and then i'm gonna tell you.

9 comments

0

its alright if its not constructive

0

Did you seriously downvote the close? This is clearly a request, and you're clearly being rep greedy.

0

yes

0

also because there is really nothing else to do here i mean look

0

^ Your answer could've been a comment and is bad in general. @OP You can use the Died event with CharacterAutoLoads or a separate Health system apart from the Humanoid to achieve this mechanic.

0

true but character autoloads is choppy and separate health system would mean u r not using the given resources to ur advantage

0

also i need my answer to be an answer to get rep

0

so that i can get as high as u and not worry about getting more rep and randomly downvote and critiscize answers that marginally do not meet conventional expectations

0

You obviously do not understand what you're saying so there isn't a benefit in correcting you. Downvoted answers are downvoted because they are bad and usually include a reason for them being bad.

1 answer

✓ Accepted answer

the easiest way would be to have a threshold number for the health of the player, in which should the player cross, will restraint his movement, make him invincible and say, force him to crawl on the ground and give him a countdown. This threshold does not need to be > 100, since u can alter the player's max health(but will of course have to be below the player's max health); a little something like this:

place in StarterPack

game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
    wait(.1) -- wait for humanoid to exist
    local hum = char.Humanoid

    hum.MaxHealth = 105 -- im setting my threshold to 100, but u should set urs to be above the most damage ur character could possibly take in one instant to prevent him from dying after taking damage
    hum.Health = 105

    hum.HealthChanged:Connect(function(hp)
        if hp <= 5 then
            hum.WalkSpeed = 1 -- do this while playing a down animation lol

            local ff = Instance.new("ForceField", char) -- this is my method of making the character invincible since i dont wanna spend so much time scripting sry!

            wait(5) -- countdown
			hum.Health = 0 -- kill him; and im sorry i did not make a save function but if u want one pm me
        end
    end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.