I have this knife/sword script that wont work properly. The aim of this script is to damage anyone who is hit by the knife. This works but after you damage the player you cannot damage them again? Here is my script
local Blade = script.Parent.Blade local damage = script.Parent.DamagePerHit.Value local Tool = script.Parent script.Parent.Blade.Touched:connect(function(hit) if script.Parent.CanHit.Value == true then script.Parent.CanHit.Value = false if hit.Parent:FindFirstChild("Humanoid") ~= nil then hit.Parent.Humanoid:TakeDamage(script.Parent.DamagePerHit.Value) script.Parent.Parent.Parent.leaderstats.Points.Value = script.Parent.Parent.Parent.leaderstats.Points.Value+script.Parent.DamagePerHit.Value end wait(2) script.Parent.CanHit.Value = true end end)
As you can see it is programmed to take off their health whenever they touch the blade. But it only works once?
If anyone can give me a fix or even just an alternative that would be great!