How would I make it so all players could see this?
[code]
if ply:Alive() then
ply:SendLua([[ chat.AddText( Color(0,102,0, 255), "[Respawn] ", Color(255, 255, 255, 255), LocalPlayer():Nick().." you must be dead to use that command!") ]])
return end
[/code]
[code]if ply:Alive() then
local pname = ply:Nick()
for k, v in pairs( player.GetAll() ) do
v:SendLua( [[chat.AddText(Color(0,102,0, 255), "[Respawn] ", Color(255, 255, 255, 255), "]] .. pname .. [[ you must be dead to use that command!") ]])
end
end[/code]
Didn't test it, but it should work.
[editline]10th September 2013[/editline]
I guess code tags don't like string literals
Thanks man worked like a charm! I tried something similar, I take it you HAD to add those extra [[]]?
Thanks again!
You can escape the quotation marks on the inside like:
[code]v:SendLua( "chat.AddText(\"words\")" )[/code]
[CODE]v:SendLua( "chat.AddText(".. words .." )[/CODE]
[QUOTE=Busan1;42148614][CODE]v:SendLua( "chat.AddText(".. words .." )[/CODE][/QUOTE]
What is that supposed to be? SendLua isn't closed, words is going to try to be resolved as a variable, and you're trying to concatenate an unclosed string at the end.
[QUOTE=bliptec;42148703]What is that supposed to be? SendLua isn't closed, words is going to try to be resolved as a variable, and you're trying to concatenate an unclosed string at the end.[/QUOTE]
I assumed ]] .. pname .. [[ is to concatenate so I showed another way since he asked if all the ]] was required.
Sorry, you need to Log In to post a reply to this thread.