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

Right Leg can do damage by itself without playing the animation?

My problem is, i'm making an animation that can do damage but it works without animation which I don't want:

mouse.KeyDown:connect(function(key)
	if key == "e" and True then
		True = false
		local aT1 = hum:LoadAnimation(anim)
		aT1:Play()
		
		animSound:Play()
		RightArm.Touched:connect(function(hit)
			local h = hit.Parent:FindFirstChild("Humanoid")
		        if h then
			h:TakeDamage(20)
		
		wait(3)
		True = true
		end
		end)
	end
end)

1 answer

✓ Accepted answer

I ran into this thing before you need to return the hit after the animation finished

mouse.KeyDown:connect(function(key)
    if key == "e" and True then
        True = false
        local aT1 = hum:LoadAnimation(anim)
        aT1:Play()
        animSound:Play()
        RightArm.Touched:connect(function(hit)
            local h = hit.Parent:FindFirstChild("Humanoid")
                if h then
            h:TakeDamage(20)
        wait(3)
	return hit
        True = true
        end
end)
end
end)

If this worked then please accept this answer

3 comments

0

np

0

Players.Player1.Backpack.CharacterAnimationScript:22: 'end' expected (to close 'if' at line 19) near 'wait' all ends are there??

0

show me the animation script

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