Jump to content

Making a simple chat command


Grzzly

Recommended Posts

Hey, I want to know how I can possibly make a command called /discord and it'll send a message in chat saying "Join to our Discord server: invite link here". I also want to make the word Discord blurple color and all other words white as shown above. I believe this is a very simple server side command but I really don't know how to make it since I'm new to Scripting. 

Here's to hoping to see an understandable tutorial! ☺️

Link to comment
addCommandHandler("discord", function()
    local link = "https://discord.gg/SFBUHknpxy"
    if setClipboard(link) then
        outputChatBox("Copied to clipboard: #FFFFFF"..link, 187,187,187, true)
    end
end, false)

you can change the output message and color codes however you need. this will copy the discord link to your clipboard when you type /discord and send a confirmation message in your chat

If you join that discord and send me a DM, I can teach you some more about scripting. always nice to see new people getting into coding for MTA. good luck

Edited by 5150
  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...