Whenever i copy and pasted the code into a text file in the appropriate folder and filled in the placeholder text in the code it never worked when I typed !donate. I just want to be able to set up chat links for downloading assets and bring up the MOTD. I couldn't find any other source for the problem like a youtube video or other forum post, so a link to some sources of helpful in depth information on setting up stuff like this would be appreciated. Thanks.

Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.

Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.

Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.

Hooks are what Garry's Mod lets scripters use to "hook into" game events. It allows us to perform certain actions when an event happens in the game. The GM:PlayerSay hook lets us do something when someone sends a message in the chat. There are three parameters to PlayerSay: The Player that sent the message, the String that holds the text inside the message, and a Boolean (true/false) variable that says whether or not the message was sent to only the person's team or not. Since we don't care if it's team chat or not, we can ignore it in our parameter list ( everything inside of the parentheses ).

So when I said "this can be named anything" I mean the function name ( in this case, "openGoogle" ) can be named anything. If you wanted

Code: Lua

function thisIsStupid( ply, text )

that would work just as well, but you'd have to edit it in the hook.Add statement at the bottom. The parameters, again, are anything inside of the parentheses. We want something that is distinguishable as a Player, so we use ply ( again, though, this can be anything, but we use 'ply' or 'calling_ply' as a standard in gLua to make code easier to read ). The next thing PlayerSay wants us to provide is a variable for the message. On the wiki page (GM:PlayerSay) the parameter is "text", so we generally use "text" as our variable.

The "!google" on line 3 is the text that our script is checking. If the message that the person sent starts with "!google", our script will be performed ( if not, nothing will happen, at least in our script ) and the webpage "google" will be opened in their browser.

If you wanted to use this example, all you have to change is the string ( anything inside quotes [ "" ] ) next to where it says "local URL = "For example, if you wanted to link to your donation website, you would need to change where it says "http://www.google.com" to whatever your donation link is. You will also need to change the command you want to open this. Line 2 says

Code: Lua

if(string.sub( text,1,7)=="!google")then

What this is checking is if the substring ( a part of a string ) if the message sent is equal to "!google", then whatever is inside this if statement ( anything before the next "end" ) will be executed.

I see you're fairly new to Lua, so here are some links that might help:

Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.

Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.

Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.