Add Custom Commands

On this page you will learn how to add new custom commands to the chat

Create New Command Chat

  • Create the line command on the Setting.lua

  {
    name = 'test',
    help = 'Close Action',
    params = 'message',
    color = { 194, 162, 218 },
    templateId = 'test', 
    proximityRadius = 15.0, 
    adminOnly = false,
    allowHTML = false,
    blockProfanity = true
  },
  • With the templateId copy the name and go to the file config.default.js and add the line with the template

'test': '<div class="chat-message-test"><div class="test-header"><span class="test-header-label">TEST</span> <span class="test-header-id">[{0}]</span></div><div class="test-message">{2}</div></div>'
  • Go to the file .css and add the style of the message

.chat-message-test {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
  padding: 8px 12px;
  background: #0000009d;
  border-radius: 6px;
  box-shadow: 0 0 7px #0000009d;
  min-width: 30%;
  max-width: 75.85%;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  animation: fadeInLeft 0.15s ease-out;
}
.chat-message-test::after { content: ""; display: block; clear: both; }

.test-header-id, .test-header-label {
  background-color: #62373ec5;
  border: 1px solid #784e53d8;
  color: #FFFFFF;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  flex-shrink: 0;
  width: fit-content;
  margin-right: 0px;
  align-self: flex-start;
  position: relative;
  top: 0.1vw;
}

.test-message {
  color: #FFFFFF;
  line-height: 1.9;
  flex: 1;
  min-width: 0;
  display: block;
  margin-left: 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

Last updated