• chat.AddText in MP
    9 replies, posted
why chat.AddText() doesn't work in MP? in SP everything works
chat.AddText() works, if it's run on client.
yep, i run it on clientside, but anyway
Then you're doing something wrong.
[lua] icon.DoClick = function( icon ) if LocalPlayer():Health()<=(100-v.power) then surface.PlaySound( "ui/buttonclickrelease.wav" ) surface.PlaySound("items/medshot4.wav") chat.AddText(Color(0,200,0),"Here's your HealthPack!") RunConsoleCommand("heal",v.power) else chat.AddText(Color(200,0,0),"Not enough money!") end end [/lua]
bump
does anything else in the function work?
yes, everything works incorrectly but in singleplayer all okay
bump -_-
Try that, and see if it adds the text. [lua] icon.DoClick = function( icon ) if LocalPlayer():Health()<=(100-v.power) then surface.PlaySound( "ui/buttonclickrelease.wav" ) surface.PlaySound("items/medshot4.wav") chat.AddText(Color(0,200,0),"Testing to see if it works!") end end [/lua]
Sorry, you need to Log In to post a reply to this thread.