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

How can I make a player take damage?

Asked by 3 years ago

I want the player to take damage when they enter the wrong password using serverscript

    if userInput == pinNum then

        --Code if user enters correct passwords

    else
        print("wrong")
        screen.Text = "Incorrect Pin"

        --Player take damage

    end
0
I assume this is a LocalScript, and then you'll need to tell a Server Script to damage the player, possibly by using a RemoteEvent Spjureeedd 385 — 3y
0
no this is in the serverscript badcraftyt 21 — 3y
0
How do you get userInput in a Server Script? Spjureeedd 385 — 3y

1 answer

Log in to vote
0
Answered by
rabbi99 714 Moderation Voter
3 years ago

Get the player who gave the input and do:

Player.Character.Humanoid:TakeDamage(DesiredDamage)

If you have no idea how to get the player, I suggest showing more of the script.

0
Thank you, it worked! badcraftyt 21 — 3y
Ad

Answer this question