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
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
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.
Thank you, it worked!
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
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
no this is in the serverscript
How do you get userInput in a Server Script?