Jump to content

Recommended Posts

Posted

 

I have a lua function that I want to call each 10 seconds but I don’t now how to in simrail. 
the closet thing I hav come across is the PerformUpdate function but that does not fel right since it is called each frame. 


is there another way to accomplice this?

 

Posted (edited)
CreateCoroutine(function ()
	while true do
		MyFunction()
		coroutine.yield(CoroutineYields.WaitForSeconds, 10)
	end
end)

Maybe something like this?

Edited by lewnemejski
  • I agree 1
Posted
1 hour ago, lars.oj.lindner said:

I have tried that before with no success but when placing the function in EarlyScenarioStart it worked. Thankyou.

Because CreateCoroutine need to be inside of a function. Cannot be placed outside.

  • Recently Browsing   0 members

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

Important Information

Terms of Use Privacy Policy