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 do function once at while true do check?

How do I make loop check but do the function once

Like

Function check()
Print'kk'
End

While wait() do
       If value == true then
       Check()
       Elseif value == false then
       Print"ok"
      End
    End
End

I wanna do it like make checking the value inf but doing function once not printing alot of times, only once

3 comments

0

use break or return to stop the loop, use debounce to stop the function from occurring again.

0

Can u show example

0

Yes

2 answers

✓ Accepted answer
local value = true

local printMessage = print("Ok")

function check()
	-- insert programming here
end

while value == true do
if value = true then
	Check()
	value = false
else
	print(printMessage)
end
while wait(.199) do
       if value == true then
              print"kk"
              break
       end
end

1 comment

0

Where it says print use your function and use the else if you want another check if it doesn't happen the first way

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