Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why my script do not work with my module script when I use debounce in script?

Asked by 3 years ago

If I take debounce off from local script, it'll work. However, it'll hit multiple times. Can someone help?

This is my script

local module = {}
local debounce = false

function module.FireHot(hit)
    local parent = hit.Parent 
    if (parent) then
        local hum = parent:FindFirstChild("Humanoid")
        if (hum)  then

            for i = 1,5 do
                hum:TakeDamage(2)
                wait(2)
            end
        end 

    end

end
return module

This is my module script

local module = {}
local debounce = false

function module.FireHot(hit)
    local parent = hit.Parent 
    if (parent) then
        local hum = parent:FindFirstChild("Humanoid")
        if (hum)  then

            for i = 1,5 do
                hum:TakeDamage(2)
                wait(2)
            end
        end 

    end

end
return module

1
Did you accidentally paste the same script twice? Both appear to be the exact same module script BrimoireGrimoire 11 — 3y

Answer this question