Run
Runs thread-safe API code on main thread.
- task: the action to execute. Parameter input should be in Action type
- delayTime: delay time in milliseconds until the action gets executed. Parameter input should be in long type
{{#tag:syntaxhighlight| Chat.SendChatMessageToPlayer(client, "Hello right now."); Task.Run(() => {
``Chat.SendChatMessageToPlayer(client, "Hello after 5 seconds.");
}, 5000); |lang=csharp}} }}