of     1   

Weaselover2
#208301437Friday, January 27, 2017 12:50 AM GMT

For some reason the 'enabled' part of my script is not working Script: local Part = script.Parent local Damage = 20 --changeable Part.Touched:connect(function(hit) local enabled = true if enabled == true then local Character = hit.Parent Character.Humanoid.Health = Character.Humanoid.Health - Damage enabled = false wait(1) enabled = true end end) Help is appreciated.
Macbane
#208301988Friday, January 27, 2017 12:59 AM GMT

You have enabled = true after the touched function, which means it will be set to true whenever it touches something and you wait(1) is ignored
Weaselover2
#208302102Friday, January 27, 2017 1:01 AM GMT

Thanks Congrats on first post :)
Weaselover2
#208302175Friday, January 27, 2017 1:02 AM GMT

Sorry I just started scripting last week, so how would I place it?
AyeeAndrxw
#208302470Friday, January 27, 2017 1:07 AM GMT

I will kill myself looking at this script: here is the proper script: local Part = script.Parent local Damage = 20 local Enabled = true function onTouch(hit) if Enabled == true then if hit.Parent and hit ~= nil and hit.Parent:findFirstChild('Humanoid') then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - Damage Enabled = false wait(1) Enabled = true end end end Part.Touched:connect(onTouch) r+ ROBLOX enthusiast
Weaselover2
#208302743Friday, January 27, 2017 1:12 AM GMT

Thanks, that helps a lot.
Luo_Basics
#208302918Friday, January 27, 2017 1:14 AM GMT

talk about overstatement lol literally only 2 issues i would have done different with that script

    of     1