wait function lua code example

Example 1: wait function lua

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

Example 2: lua wait function

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

Example 3: how to wait in lua

wait() --parameter is seconds

Example 4: wait function rebuilt in 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)

Tags:

18 Example