Best way to takedamage?

I am create a script takedamage but I don’t know if this is the best way. Can you show me the best way?
This is my script

Local object ={}
sword.Touched:connect(function(hit)
local fhum = hit.Parent:Findfirstchild(“humanoid”)
If fhum ~= nil then
If table.find(object,fhum.Name) == nil then–find name player
Take damage
Table.insert(object,fhum.Name)
End
End
End)

2 Likes

Use the Humanoid:TakeDamage()

30000 chars

1 Like

If you want to damage the player with a forcefield or not, you should manually set its Health. Otherwise, Humanoid:TakeDamage will suffice.

1 Like