Auto-translated
while 1 do -- an infinite loop, meaning we've simply created a cycle that checks something.
sleep(1) -- a small pause for checking; if you remove it, the check will be continuous, and the game will crash. But with it, there's a very small, imperceptible pause between checks for the player.
if -- an argument for the check. In this case, while starts the check, sleep prevents the game from being overloaded; it itself is ignored, and only what is written in if and далее is checked.
startThread(funcname) -- starts this check-function right from the beginning of the game. You can write it at any time you need. The if check will start immediately, with an interval of sleep(1), and will continue until break.
function funcname ()
while 1 do
sleep(1)
if
--what you need to check continuously
break -- after it, the entire cycle stops working. It simply ends to avoid overloading the game.
end
end
end
startThread(funcname)
Here is the code for checking something. In if and далее, you write what you need to check. In the parentheses of startThread, you specify (without quotes) the function that needs to be launched -- funcname.
Something like that. ;)