Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Will Not Do Damage to Other Players Help?

Asked by 8 years ago
player = game.Players.LocalPlayer

m = player:GetMouse()

Punch = script:WaitForChild("Punch")

tool = script.Parent

Rarm = player.Character["Right Arm"]

arm = Rarm

local damage = 5

tool.Selected:connect(function(m)
    m.Button1Down:connect(function()        
        local animateTrack = player.Character.Humanoid:LoadAnimation(Punch)
        animateTrack:Play()
    end)
end)

arm.Touched:connect(function()
    if equipped and character and humaniod and humanoid.Health > 0 and hit and not hit:isDescendantOf(character) then
        local targethumaniod = hit.Parent:findFirstChild("Humaniod")        
        if targethumanoid and targethumanoid.Health > 0 then
            targethumaniod:TakeDamage(damage)
        end
    end
end)

1 answer

Log in to vote
0
Answered by
Marios2 360 Moderation Voter
8 years ago

If that script is yours then i am Chuck Norris. Anyway you give up very easily - the one and only error is "Humaniod".

local player = game.Players.LocalPlayer

local m = player:GetMouse()

local Punch = script:WaitForChild("Punch")

local tool = script.Parent

local Rarm = player.Character["Right Arm"]

local arm = Rarm

local damage = 5

tool.Selected:connect(function(m)
    m.Button1Down:connect(function()        
        local animateTrack = player.Character.Humanoid:LoadAnimation(Punch)
        animateTrack:Play()
    end)
end)

arm.Touched:connect(function()
    if equipped and character and humanoid and humanoid.Health > 0 and hit and not hit:IsDescendantOf(character) then
        local targethumanoid = hit.Parent:FindFirstChild("Humanoid")        
        if targethumanoid and targethumanoid.Health > 0 then
            targethumanoid:TakeDamage(damage)
        end
    end
end)


0
still not doing any damage but you did fix a lot of the script ill take a picture and show you oh and this is a hopperbin tool KillerTeenGaming 5 — 8y
Ad

Answer this question