i tried to make it but its not working :(

local animl = script.Animation

local tool = script.Parent

local canDamage = false

local player = game.Players.LocalPlayer

local char = player:WaitForChild("Character")

local hum = char.Humanoid

local anim = hum:LoadAnimation(animl)



local function onTouch(otherPart)



	local humanoid = otherPart.Parent:FindFirstChild("Humanoid")



	if not humanoid then 

		return 

	end



	if humanoid.Parent ~= tool.Parent and canDamage then 

		humanoid:TakeDamage(5)

	else

		return

	end



	canDamage = false

end



local function slash()

	local str = Instance.new("StringValue")

	anim:Play()

	canDamage = true

end



tool.Activated:Connect(slash)

tool.Handle.Touched:Connect(onTouch)

1 comment

0

Do you own the animation? What priority is it?