Hello! Could someone help me? please…
I need to modify this code so that the damage is generated with the Left Arm and the Right Arm, how can I do it? someone could help me, please …
script.Parent.Animations.LightHitAnim.OnServerEvent:Connect(function(plr)
print("Connected to light hit anim.")
-- Damage functions
local AttackDist = 10 --If a player is further than this value, they won't be damaged.
for i,v in pairs(game.Players:GetChildren()) do --Loops through all players.
if v.Character ~= nil and plr.Character ~= nil and v ~= plr then --Checks if there's a character
local pRoot = plr.Character:FindFirstChild("HumanoidRootPart")
local vRoot = v.Character:FindFirstChild("HumanoidRootPart")
if pRoot and vRoot and (plr.Character.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).Magnitude < AttackDist then --Checks if the Root parts exist and if the player is in range.
local Hum = v.Character:FindFirstChild("Humanoid")
if Hum and Hum.Health > 0 then --Checks if player is alive.
Hum.Health = Hum.Health - 10 --Change "100" to the damage the player should take.
wait(1)
end
--Stuff that happens when a player is in range.
end
end
end
end)