So I am attempting to make an npc have a combo system, however it isn’t working, it only plays the first animation and repeatedly plays only the first one. Can somebody tell me whats wrong with my script? No output errors btw.
local Anim = Enemy:LoadAnimation(Animation)
local Anim1 = Enemy:LoadAnimation(Animation1)
local number = 1
function Hit(hit)
if hit.Parent ~= nil then
local TargetHum = hit.Parent:FindFirstChild("Humanoid")
if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent:FindFirstChild("Humanoid"):IsA("Humanoid") and AttackEnabled == true and TargetHum ~= Enemy then
if not hit.Parent:FindFirstChild("NPC") then
AttackEnabled = false
delay(.5,function() AttackEnabled = true end)
if Anim and number == 1 then Anim:Play() number = 2 end
if Anim and number == 2 then Anim1:Play() number = 1 end
DamageTag(TargetHum.Parent,5)
end
end
end
end
Sorry for replying so late, but wouldnt that just make it where it only plays the animation and would not do damage? And also it says That Completed is not part of Anim or something along those lines