Jump to content

Recommended Posts

Posted

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!!!

Posted (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 by Chump
lol @ ChatGPT
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...