Author Topic: HEEEEEEELP  (Read 255 times)

0 Members and 1 Guest are viewing this topic.

Offline Butcher1993

  • Sr. Member
  • ****
  • Posts: 307
  • Karma: +11/-8
  • Gender: Male
  • Get Some (Shoots you in face)
    • View Profile
    • Butcher's Site
HEEEEEEELP
« on: September 21, 2009, 12:20:30 PM »
OK, I have a script. Where do i put it, how do i execute it, etc. Also, this does put colored chat in the chat box so that EVERYBODY can see it, not just me right lol

chat.AddText(
    "Hello, ",
    Color(255,255,255), "this", " is ",
    Color(255,0,0), "red, ",
    Color(0,255,0), "green, ",
    Color(0,0,255), "blue")
chat.PlaySound()
My Weapons
Sniper
http://www.youtube.com/watch?v=gQPgmRRcI3o
Side Arm
http://www.youtube.com/watch?v=5qQoOlyo05Q
Me in my Ghillie Suit LOOK AT THIS VIDEO OF HOW WELL MY GHILLIE BLENDS IN http://www.youtube.com/watch?v=SLD8ivnIEhY
[img width=215 height=256]http://img532.imageshack.us/img532/4425/sany

Offline Minic

  • Regular Member
  • ***
  • Posts: 105
  • Karma: +16/-1
  • Gender: Male
  • The superior OS.
    • View Profile
Re: HEEEEEEELP
« Reply #1 on: September 22, 2009, 02:35:03 AM »
That code should work, chat.AddText is client side only, it takes color, then string, color, then string, etc.

If you run that on your client, only you will see it.

This is where it gets a bit confusing.

For other people to see it, it either needs to be in a client side function of some sort they have locally, and have the server "call" it, typically with a umsg.

Or you could SendLua it to have it execute directly.

As far as executing it on your own game, make like.

garrysmod\garrysmod\lua\test.lua

Throw it in there, then in game, in the console type "lua_openscript_cl test.lua".

Then you should have pretty colored text, and the sound should play.

DISCLAIMER: I didn't actually test any of this, but it should work fine. ;D

Hope it helps, get to me on Steam if you need more lua help.

-Minic
« Last Edit: September 22, 2009, 02:37:39 AM by Minic »