Here's my script;
local Sword = script.Parent
local Hitting = false
local Dmg = script.Parent.Parent:WaitForChild('Stats').Damage
Sword.Touched:Connect(function(hit)
print('TOUCHED THE GOD')
if hit.Parent:FindFirstChild('Humanoid') then
if Hitting == false then
Hitting = true
if Hitting == true then
return
else
local Enemy = hit.Parent:FindFirstChild('Humanoid')
Enemy.Health = Enemy.Health - Dmg.Value
wait(2)
Hitting = false
end
end
end
end)
This is a Server Script inside of a part inside of a model.
Stats is a folder inside the model.
Inside stats we have the stats (duh) they are number values.
I'm not sure if I did something wrong but It's not doing damage.
Thank you for any feed back support and help.

1 comment
You should use GetPlayerFromCharacter(hit)