local animator = script.Parent:WaitForChild("Humanoid"):WaitForChild("Animator")
local attackanim = script:WaitForChild("attackanim")
local attackanimTrack = animator:LoadAnimation(attackanim)
local range = script.Parent:WaitForChild("range")
local vfx = script.Parent:WaitForChild("vfx"):WaitForChild("vfxparry")
local playerhitted = {}
range.Touched:Connect(function(somethingtouchedrange)
if somethingtouchedrange.Parent:FindFirstChild("Humanoid") then
if somethingtouchedrange.Parent:FindFirstChild("Humanoid").Health > 0 and not table.find(playerhitted, somethingtouchedrange.Parent) then
table.insert(playerhitted, somethingtouchedrange.Parent)
attackanimTrack:Play()
attackanimTrack.Priority = Enum.AnimationPriority.Movement
for time = 1, 10 do
print("zom cd:", time)
task.wait(1)
if time == 10 then
table.clear(playerhitted, somethingtouchedrange.Parent)
end
end
end
end
end)
attackanimTrack:GetMarkerReachedSignal("vfxparrystart"):Connect(function(vfxparryhasstarted)
if vfxparryhasstarted then
print("vfxparry started")
vfx:Emit(1)
end
end)