Sword.Touched:Connect(function(Touch)
for _, Player in ipairs(game:GetService("Players"):GetPlayers()) do
if Player.Character:IsAncestorOf(Touch) and Attacking == true then
print("hit")
AttackedTarget = Player
if Touch.Parent.Humanoid:GetAttribute("Blocking") == true then
print("Blocked")
remoteEvent:FireClient(AttackedTarget, "Blocked")
Touch.Parent.Humanoid:TakeDamage(Damage/5)
elseif Touch.Parent.Humanoid:GetAttribute("Parrying") == true then
print("PARRIED!")
remoteEvent:FireClient(AttackedTarget, "Parried")
elseif Touch.Parent.Humanoid:GetAttribute("Iframe") == true then
print("Dodged")
remoteEvent:FireClient(AttackedTarget, "Dodge")
else
Touch.Parent.Humanoid:TakeDamage(Damage)
remoteEvent:FireClient(AttackedTarget, "Hitted")
end
Attacking = false
break
end
end
end)
Sword.Touched:Connect(function(Touch)
print("Works about to here!")
for _, Player in ipairs(game:GetService("Players"):GetPlayers()) do
print("Everything works here!")
if Player.Character:IsAncestorOf(Touch) and Attacking == true then
print("hit")
AttackedTarget = Player
if Touch.Parent.Humanoid:GetAttribute("Blocking") == true then
print("Blocked")
remoteEvent:FireClient(AttackedTarget, "Blocked")
Touch.Parent.Humanoid:TakeDamage(Damage/5)
elseif Touch.Parent.Humanoid:GetAttribute("Parrying") == true then
print("PARRIED!")
remoteEvent:FireClient(AttackedTarget, "Parried")
elseif Touch.Parent.Humanoid:GetAttribute("Iframe") == true then
print("Dodged")
remoteEvent:FireClient(AttackedTarget, "Dodge")
else
Touch.Parent.Humanoid:TakeDamage(Damage)
remoteEvent:FireClient(AttackedTarget, "Hitted")
end
Attacking = false
break
end
end
end)