Skip to main content

WaitForMainThread

Waits for the main thread before executing API related functions.

C#​

Task<object>NAPI.Task.WaitForMainThread([long delayTime = 0]);

Parameters​

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

Example​

NAPI.Task.WaitForMainThread();
NAPI.Chat.SendChatMessageToPlayer(player, "We are in main thread now.");