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

How do I make a pcall repeat infinitely?

Asked by 2 years ago

Hi, I don't know how to repeat a pcall infinitely. Does anyone know?

pcall(function(Succes, Error)

    StarterGui:SetCore("ResetButtonCallback", false)

    if Error then

        StarterGui:SetCore("ResetButtonCallback", false)
    end
end)
1
Use the while true do loop MAD_DENISDAILY2 137 — 2y

1 answer

Log in to vote
1
Answered by
CodeWon 181
2 years ago

Simpy use a while true do loop:

while true do

    wait(0.1) -- Add a wait so the script doesn't go too fast and break

    -- All the code below will run every 0.1 seconds because of the wait()

    local success, failed = pcall(function()
           StarterGui:SetCore("ResetButtonCallback", false)
    end)

    if failed then
        StarterGui:SetCore("ResetButtonCallback", false)
    end


end

I hope this was helpful!

Ad

Answer this question