User Tools

Site Tools


chat_class:send_chat_example

Table of Contents

SendChat

How to use

 Chat:sendChat(content, targetuin) 

Where:

  • content string (The message that the player will send)
  • targetuin number (The Uid of the player that will send the message)

And returns:

  • ErrorCode.Ok (0 if execution was succesful and 1001 if the execution failed)

Use example

When the player presses the “Q” key, He will send a message.

ScriptSupportEvent:registerEvent([=[Player.InputKeyDown]=], function(e) 
 
    local playerid = e['eventobjid']
    local curKey = e['vkey']
 
    if curKey == "Q" then 
        Chat:sendChat("Unlimited power!!!", playerid)
    end
end)
chat_class/send_chat_example.txt · Last modified: 2024/06/30 20:14 by notsopro