How to efficiently stop refreshing text

Hey developers,

I’m trying to make a loading screen that refreshes every 10 seconds, but after the loading screen disappears I don’t want it to continue refreshing since it impacts performance (probably not that much, but still). How would I do this? I haven’t coded in a few months. I would appreciate any help!

Have a nice day, iamajust

local running = true
local function Update()
	--stuff..
end

local function End()
	running = false
end

repeat
	Update()
	task.wait(10)
until not running
--stuff after it finishes

1 Like

Thank you so much for the answer! I really appreciate your help!