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

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

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

1 answer

✓ Accepted answer

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.

1 comment

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

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