SendLua() Confusion

Hey! I got this SendLua confusion.
I made this line:

[lua]
chat.AddText(Color(129,129,129), "(( " , col, v:Nick(), ": “, Color(255,255,255) , text , Color(129,129,129), " ))”)
[/lua]

Now I need to send it to the client from server with SendLua()
Which I find very confusing with all this “/”-ish things.

Can somone explain how this works? And make a code that works like I want it? :slight_smile:
Thanks!

v:Nick() and “text” and “col” are stuff that I get from server side.

\ is an escape character. It prevents " from being treated as a string operator and instead uses it as a character.

So this code:

print("Hi “This is in quotes” ")

would output:

Hi “This is in quotes”

A string can also be represented like so:

[lua]
mystring = [[ A very long string should be emedded in these
especially if it’s multilined. ]]
[/lua]

So you can use SendLua like so:

[lua]
player_object:SendLua([[chat.AddText(Color(129,129,129), "(( " , col, v:Nick(), ": “, Color(255,255,255) , text , Color(129,129,129), " ))”)]])
[/lua]

[editline]09:30PM[/editline]

Odd the board syntax highlighter doesn’t pick up on 'em.

Hmm okey… But v:Nick() and col and text doesn’t get picked up from the serverside script before it sends to the client

concatenate it in.

pl:SendLua("chat.AddText(Color(125 , 125 , 125) , “Player” “…v:Nick()…” “sucks balls.” ")