• E2 Help
    2 replies, posted
Hey so I am trying to make a chat command with e2, I made one but it only works for myself I was wondering if I could make a e2 that will work for everyone. For example if someone says "god" the e2 will make me type "!god thereusernamehere" or do a console command like "ulx god thereusernamehere". I was thinking a way to do this was to check if a player typed "god" and if they did take there ign and run one the the commands on it. But i'm new to e2 and have no idea how to do it.
This code should do what you want, commentated for explanation. @name God command runOnChat(1) if( chatClk() ) {     Words = lastSaid():explode(" ") #split up chat message by space     if( Words:count() == 1 && Words[1,string] == "god" ) { #if the word count is 1 and the word is god         Name = lastSpoke():name():replace(";","") #replace any semicolons in names to prevent command injection         concmd("say !god "+Name) #execute the command     } }
It worked thank you so much!
Sorry, you need to Log In to post a reply to this thread.