대기 기능 루아
function wait(seconds)
local start = os.time()
repeat until os.time() > start + seconds
end
--Exactly the same as the roblox one!
lua 에서 wait()
wait(5) -- Waits 5 seconds then prints "Hello world!"
print("Hello world!")
수면 기능 루아
local clock = os.clock
function sleep(n) -- seconds
local t0 = clock()
while clock() - t0 <= n do end
end
루아에서 기다리는 법
wait() --parameter is seconds
루아 대기 기능
local function wait(seconds)
local time = seconds or 1
local start = os.time()
repeat until os.time() == start + time
end