Hi. I'd like to add knockback to this NPCs damage script. Unfortunately, I'm not that experienced with Roblox Studio. Could someone please give me an example of how this can be done? Thanks!
Here's the NPCs script:
local hum = script.Parent.Parent.Humanoid
local banditpunch1 = hum:LoadAnimation(script.BPunch1)
local human
local debounce = false
part = script.Parent
script.Parent.Touched:connect(function(hit)
if debounce == false then
debounce = true
human = hit.Parent:FindFirstChild("Humanoid")
if (human ~= nil) then
banditpunch1:Play()
wait(.12)
human.Health = human.Health - 5
end
wait(1)
debounce = false
banditpunch1:Stop()
end
end)

1 comment
WOW! THANKS! After like about 4 hours FINALLY! I changed it a bit but it works.