#How would i make a part that deals damage consistently when a player is stood inside of it?

12 messages · Page 1 of 1 (latest)

pine totem
#

alr wait lemme do that rq

#

@cunning valve u still here?

#

uuh

#

hello?

#

well here's the script

#
istouching = false

part = script.Parent

part.Touched:Connect(function(touched)
    
    if touched.Parent:FindFirstChild("Humanoid") then
        
        istouching = true
        
        print("Touched!")
        
        while istouching == true do
            wait(.5)
            touched.Parent.Humanoid:TakeDamage(5)
        end
        
    end
    
    
end)

part.TouchEnded:Connect(function(touched)

    if touched.Parent:FindFirstChild("Humanoid") then
        
        print("Not Touching!")
        
        istouching = false

    end

end)
cunning valve
#

uh

#

ill try it out

#

if the part touches multiple parts

#

it deals more damage

#

than inteded

#

how would i fix that?