Need help with this code!!

So i’m making an entity and when a medic uses it, he can set a value everything is working except this

cl_init.lua
[lua]function DermaNumSlider:OnValueChanged( value )

  print(value)		
  net.Start("price555")

  net.WriteUInt( value, 32 )

  net.SendToServer()  

end[/lua]

init.lua
[lua]
util.AddNetworkString(“price555”)

net.Receive(“price555”,function()

self:SetPrice12(net.ReadUInt(32))
print(self:GetPrice12())

end)[/lua]

for some reason whenever the numslider is closed, the value isn’t saved and its just set back to 0

any way to fix this?

[editline]15th January 2017[/editline]

solved it myself