What you can probably do if its a while true loop or some other loop is check if a value you defined earlier is false or true
For example:
local Check = false
coroutine.wrap(function()
while Check == false do
print("Running")
wait(0.1)
end
end)()
wait(5)
Check = true
You could also use the same logic for a function you have defined:
local Check = false
function GoodFunction()
coroutine.wrap(function()
if Check == false then
repeat
print("Good")
wait(0.1)
until Check == true
end
end)()
end
GoodFunction()
wait(5)
Check = true
Let me know if you have any issues!
1 comment
try taking a look at https://developer.roblox.com/en-us/api-reference/lua-docs/coroutine it should work for this