Introductions/Apps/Suggestions > Help/Requests

HEEEEEEELP

(1/1)

Butcher1993:
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()

Minic:
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

Navigation

[0] Message Index

Go to full version