数日前に LUA の学習を開始し、Tabletop Simulator ゲーム内で自分のプロジェクトを開始しましたが、レンガの壁にぶつかりました。Wait クラスに時間を追加できません。
これは私が試したものの例です:
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 秒後に 2 番目の部分を実行する必要があります。そうでない場合は、2 番目の部分を通常どおり実行し、「i = i + 1」をスキップします。私の問題は、関数がすべてを同時に実行することです。何か間違ったことをしていることは知っていますが、何が悪いのかわかりません。すべてを順番に行うための for of gate を作成する方法などはありますか?