Simple vars from init to cl_init?

How do i transfer simple variables (example: self.twoplustwo = 4) from… lets say: init to cl_init?

Usermessages, Networked vars, etc.

Declare it shared, unless the variable is going to change. Otherwise, usermessages.

I dont quite understand how to use usermessages, looked on wiki, but still dont know how to use them… How would i be able to use it exactly?

init.lua
[lua]
local twoplustwo = 4
local rp = RecipientFilter()
umsg.Start(“number”, rp)
umsg.Short(twoplustwo)
umsg.End()
[/lua]
cl_init.lua

[lua]
usermessage.Hook(“number”, function(um)
local number = um:ReadShort()
print(number)
end)
[/lua]
Server
[lua]
function blah(ply)
ply:SetNWInt(“twoplustwo”, 4) – Op is better off using this
end
hook.Add(“PlayerSpawn”, “nu”, blah)
[/lua]

Client
[lua]
print(LocalPlayer():GetNWInt(“twoplustwo”))
[/lua]

or you could use datastream if it’s a table, but you need to avoid it when ever you can

UserMessage Server -> Client
DataStream Client -> Server, Maybe Server -> Client not sure…

Nope just a simple float var

Used those, thanks, works perfectly.