Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a pcall repeat infinitely?

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 comment

1

Use the while true do loop

1 answer

✓ Accepted answer

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.