Lua wait function

Code examples

3
0

wait function lua

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

wait() in lua

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

sleep function lua

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

how to wait in lua

wait() --parameter is seconds
0
0

lua wait function

local function wait(seconds)
    local time = seconds or 1
    local start = os.time()
    repeat until os.time() == start + time
end
0
0

how to wait lua

wait(1)

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................