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

What is the best way to inflict damage on a player?

Asked by
neoG457 315 Moderation Voter
9 years ago

I was making a projectile attack but I don't know which method I should use to damage the dummy.

1 answer

Log in to vote
0
Answered by
unmiss 337 Moderation Voter
9 years ago

You can do this by either: Using the TakeDamage function on the dummy's humanoid:

game.Workspace.Dummy.Humanoid:TakeDamage(amount)

or, simply subtract from their health.

game.Workspace.Dummy.Humanoid.Health = game.Workspace.Dummy.Humanoid.Health - amount

I would recommend TakeDamage. Hope I helped.

0
TakeDamage is affected if the user you are targeting has a ForceField, if they have a forcefield then they will not lose the health :3 Ryzox 220 — 9y
Ad

Answer this question