if dist <= near then
		
		PlayAttack1.Value = true
		if PlayAttack1.Value == true then
			playAttackAnim1:Play()
			rightarm.Touched:connect(function(hit)
			local targetHumanoid = hit.Parent:WaitForChild'Humanoid'
				if targetHumanoid and Rtouch == false then
					Rtouch = true
					targetHumanoid:TakeDamage(math.random(3))
					wait(2)
					Rtouch = false
				end
			end)
			
			wait(.6)
			PlayAttack2.Value = true
			if PlayAttack2.Value == true then
				playAttackAnim2:Play()
				wait(.6)
			end
		end
	end

heres a link so you can witness whats going on https://www.youtube.com/watch?v=IaBuFZYmxok&feature=youtu.be

so yeah the damage keeps multiplying up instead of adding

6 comments

1

math.random() needs two parameters,

1

you should maybe consider using "FindFirstChild" instead of 'WaitForChild'. "WaitForChild" will wait forever if a humanoid isn't found.

1

Math.random need no parameters, but 2 is it's max.

2

This tabbing is terrible

1

There is no problem here

1

Yeah I agree with Narrev, but maybe try to replace:TakeDamage() with targetHumanoid.Health = targetHumanoid.Health - math.Random(3). I know it's complicated but it might work.