“Função de espera da Lua” Respostas de código

Espere função lua

function wait(seconds)
    local start = os.time()
    repeat until os.time() > start + seconds
end
--Exactly the same as the roblox one!
Tes

Função do sono Lua

local clock = os.clock
function sleep(n)  -- seconds
  local t0 = clock()
  while clock() - t0 <= n do end
end
Average Alligator

Wait Função reconstruída em Lua

function wait(seconds)
  local start = os.time()
  repeat until os.time() > start + seconds
end

-- This is the wait function (mostly known from roblox)
-- It works exactly like the roblox version
-- It's used like this: wait(how many seconds)
Stupid Skipper

espere () em lua

wait(5)  -- Waits 5 seconds then prints "Hello world!"
print("Hello world!")
Sticky

Função de espera da Lua

function wait(n)
	os.execute("sleep "..tostring(tonumber(n)))
end


-- the reason we're doing this is because lua
-- doesn't have a built in wait function
-- unless it's roblox lua or other types,
-- but this is for vanilla lua
Colorful Capuchin

Função de espera da Lua

wait(5)
pro gamer

Respostas semelhantes a “Função de espera da Lua”

Perguntas semelhantes a “Função de espera da Lua”

Mais respostas relacionadas para “Função de espera da Lua” em Lua

Procure respostas de código populares por idioma

Procurar outros idiomas de código