เดี๋ยวก่อนฟังก์ชัน language
function wait(seconds)
local start = os.time()
repeat until os.time() > start + seconds
end
--Exactly the same as the roblox one!
เดี๋ยว()ใน language
wait(5) -- Waits 5 seconds then prints "Hello world!"
print("Hello world!")
นอนฟังก์ชัน language
local clock = os.clock
function sleep(n) -- seconds
local t0 = clock()
while clock() - t0 <= n do end
end
วิธีการออยู่ใน language
wait() --parameter is seconds
language เดี๋ยวก่อนฟังก์ชัน
local function wait(seconds)
local time = seconds or 1
local start = os.time()
repeat until os.time() == start + time
end