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

How To Reanimate a player? [closed]

Asked by 5 years ago

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.

0
its alright if its not constructive TheluaBanana 946 — 5y
0
Did you seriously downvote the close? This is clearly a request, and you're clearly being rep greedy. DinozCreates 1070 — 5y
0
yes TheluaBanana 946 — 5y
0
also because there is really nothing else to do here i mean look TheluaBanana 946 — 5y
View all comments (5 more)
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. xPolarium 1388 — 5y
0
true but character autoloads is choppy and separate health system would mean u r not using the given resources to ur advantage TheluaBanana 946 — 5y
0
also i need my answer to be an answer to get rep TheluaBanana 946 — 5y
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 TheluaBanana 946 — 5y
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. xPolarium 1388 — 5y

Closed as Not Constructive by DinozCreates, TheluaBanana, xPolarium, and Gey4Jesus69

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
-2
Answered by 5 years ago
Edited 5 years ago

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)
Ad