wait function rebuilt in lua
function wait(seconds)
local start = os.time()
repeat until os.time() > start + seconds
end
- Define a function named "wait" with a parameter "seconds".
- Declare a local variable "start" and assign it the current time using the os.time() function.
- Create a repeat loop that continues until the current time exceeds the sum of the start time and the input "seconds".
- End the function.