Strange "attempt to perform arithmetic on a function value" error in lua

Arr*_*At1 1 lua

I'm writing a BASIC interpreter in plain Lua, have hit a wall when writing my SLEEP X function.

I'm no expert but nothing looks wrong here...

function s(time)
local time=tonumber(time)
if useSleep then sleep(time) elseif useWait then wait(time) else
--oh no
--we will try our best
local ct=os.time+time
repeat until(os.time>=ct)
end end
--test
s(5)
Run Code Online (Sandbox Code Playgroud)

lhf*_*lhf 5

You need to call os.time, with os.time().

os.time is the function.

os.time() is its result.