Simple LUA Question

LocalPlayer():ConCommand("say /hit " … pName … " " … pPay)

How would I do:

LocalPlayer():ConCommand("say “/hit " … pName … " " … pPay … “””)

I’m trying to run a chat command but it doesn’t get run correctly, anything I’m doing wrong?

What are you trying to do? If you want to use " in a string you should either:
Escape it: [lua]local examplestr = “My name is “”…name…”". Cool huh?"[/lua]
Or you can use different quotes: [lua]local examplestr = ‘My name is "’…name…’". Cool huh?’[/lua]

Also: Chat commands are usually linked to console command, you could try just executing those.

OP has 1 too many quotation marks at both his examples.

OP, use code tags, and also I don’t get what you’re asking to do.


You should put a little more effort into your threads, or no one will help you.


Nor CAN they help you.