SendLua() Confusion

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

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

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:

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:

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

So you can use SendLua like so:

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


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.” ")