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
function wait(seconds)
local start = os.time()
repeat until os.time() > start + seconds
end
--Exactly the same as the roblox one!
local clock = os.clock
function sleep(n) -- seconds
local t0 = clock()
while clock() - t0 <= n do end
end
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)
wait(5) -- Waits 5 seconds then prints "Hello world!"
print("Hello world!")
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
wait(5)