Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Will Not Do Damage to Other Players Help?

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

✓ Accepted answer

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)


1 comment

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

This discussion is preserved as it was. New answers, comments, and votes are closed.