“Lua Tunggu Fungsi” Kode Jawaban

Tunggu fungsi lua

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

fungsi tidur lua

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

Tunggu fungsi yang dibangun kembali di 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

tunggu () di Lua

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

Lua Tunggu Fungsi

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

Lua Tunggu Fungsi

wait(5)
pro gamer

Jawaban yang mirip dengan “Lua Tunggu Fungsi”

Pertanyaan yang mirip dengan “Lua Tunggu Fungsi”

Lebih banyak jawaban terkait untuk “Lua Tunggu Fungsi” di Lua

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya