【发布时间】:2020-07-25 12:59:30
【问题描述】:
我几天前开始学习 LUA,在 Tabletop Simulator 游戏中开始了我自己的项目,但我碰壁了。我无法为等待课程增加时间。
这是我尝试过的一个例子:
function state_check()
--This function checks if the state of obj_1 and obj_2 is 0 or 1
end
function press_button()
--This function activates other functions based on the state of obj_1 and obj_2
i = 1 --Function starts with a wait of 1 second
if obj_1_state == 1 then --If state is 1, then the function is triggered and 1 second is added to i
Wait.time(func_1, i)
i = i + 1
end
if obj_2_state == 1 then
Wait.time(func_2, i)
end
end
我需要该函数检查第一部分,如果为真,请在 1 秒后执行第二部分。如果没有,请正常执行第二部分并跳过“i = i + 1”。 我的问题是该函数同时执行所有操作。我知道我做错了什么,但我不知道是什么。有没有办法创建一些 for of gate 来按顺序执行所有操作或类似的操作?
【问题讨论】:
标签: lua moonsharp tabletop-simulator