of     1   

chandrakantswarnkar
#221201921Thursday, July 13, 2017 9:42 AM GMT

char.LeftHand.Touched:Connect(function(hit) local tkdmg = true local ehum = hit.Parent:FindFirstChild('Humanoid') if ehum and tkdmg then tkdmg = false ehum:TakeDamage(20) wait() end end) It does damage more than that or just keeps doing damage. how do I stop it?!
Lametta
#221202593Thursday, July 13, 2017 10:09 AM GMT

deb = false TimeBeforeNextDamage = 1 -- in seconds char.LeftHand.Touched:Connect(function(hit) if deb == false then deb = true local tkdmg = true local ehum = hit.Parent:FindFirstChild('Humanoid') if ehum and tkdmg then tkdmg = false ehum:TakeDamage(20) wait(TimeBeforeNextDamage) deb = false end end)
Lametta
#221202632Thursday, July 13, 2017 10:10 AM GMT

My bad, to prevent errors you may want to do this: deb = false TimeBeforeNextDamage = 1 -- in seconds char.LeftHand.Touched:Connect(function(hit) if deb == false then deb = true local tkdmg = true local ehum = hit.Parent:FindFirstChild('Humanoid') if ehum and tkdmg then tkdmg = false ehum:TakeDamage(20) wait(TimeBeforeNextDamage) end deb = false end)
chandrakantswarnkar
#221202746Thursday, July 13, 2017 10:15 AM GMT

hmm thank you! but I changed some things in my own way and that worked too :P anyway how do I stop the health regeneration? :<
IntelligentBeing
#221206283Thursday, July 13, 2017 12:19 PM GMT

theres a script responsible for health regeneration inside the character. disable it as soon as the player joins. (this might also disable the ability for them to die so you might have to fix that too)
FumeiSencho
#221208725Thursday, July 13, 2017 1:25 PM GMT

Go in StarterCharacterScripts and put a blank Server Script named Health.
chandrakantswarnkar
#221217863Thursday, July 13, 2017 4:18 PM GMT

Got it! thanks!!!

    of     1