Bestiajez Posted February 20, 2023 Posted February 20, 2023 Hi people Very good people. I need to create a script inside a mission that counts down from 60 seconds. I have spent several hours and it does not work for me. I have been messing with lua programming and there is no way. even chatgpt has programmed one for me that doesn't work either... I've looked at pages and pages and it always gives me an error. If you can give me a hand. Thanks in advance!!!
Chump Posted February 20, 2023 Posted February 20, 2023 (edited) @Bestiajez MiST (https://github.com/mrSkortch/MissionScriptingTools/releases) makes a repetitive scheduled event very simple. You could do something like this inside a ONCE / DO SCRIPT trigger (after adding MiST in a MISSION START/DO SCRIPT FILE trigger beforehand): countdown_num = 60 local function showMsg() trigger.action.outText(tostring(countdown_num), 1) countdown_num = countdown_num - 1 if countdown_num == 0 then countdown_num = nil end end mist.scheduleFunction(showMsg, {}, timer.getTime(), 1, timer.getTime() + 60) Edited February 20, 2023 by Chump lol @ ChatGPT
Bestiajez Posted February 20, 2023 Author Posted February 20, 2023 is perfect!!!!! THANKS THANKS THANKS!!!!!
Recommended Posts