Skip to main content

WaitForMainThread

Waits for the main thread before executing API related functions.

  • delayTime: delay time in milliseconds until the action gets executed. Parameter input should be in long type

{{#tag:syntaxhighlight| Task.WaitForMainThread(); Chat.SendChatMessageToPlayer(player, "We are in main thread now."); |lang=csharp}} }}