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 player = game:GetService("Players")
local mobs = game.Workspace:WaitForChild("currentmob"):GetChildren()
local playerhitted = {}
range.Touched:Connect(function(somethingtouchedrange)
if somethingtouchedrange.Parent:FindFirstChild("Humanoid") and player:GetPlayerFromCharacter(somethingtouchedrange.Parent) 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
task.wait(10)
table.clear(playerhitted, somethingtouchedrange.Parent)
end
end
end)
attackanimTrack:GetMarkerReachedSignal("vfxparrystart"):Connect(function(vfxparryhasstarted)
if vfxparryhasstarted then
print("vfxparry started")
vfx:Emit(1)
end
end)