Healing the player

I’m having trouble healing the player in my gamemode. I’m running this code in cl_init.lua

[lua]ply:SetHealth(ply:Health() + 20 )[/lua]

I have tried running it through a derma button and through a keypress hook but they don’t do anything.

it seems to work on server but not on client. Is there some trick to get it to work on client? It says the function is shared on the Wiki.


(User was banned for this post ("Wrong section" - mahalis))

Make a concommand serverside, like
[lua]
concommand.Add(“healme”, function(ply) ply:SetHealth(ply:Health() + 20) end)
[/lua]

then on clientside, use RunConsoleCommand(“healme”).