Help w/ Convars

I’m having trouble retrieving server side convars. No matter what flags I use to create a convar, the client will always only use a local version of the convar, and can’t get the server’s version.

Shared Script


CreateConVar("re_lbrightness","0",FCVAR_ARCHIVE,FCVAR_REPLICATED,FCVAR_SERVER_CAN_EXECUTE,FCVAR_LUA_SERVER)

Server Script, changing the value of the ConVar (works perfectly)


GetConVar("re_lbrightness"):SetFloat(1.0)

Client Script trying to retrieve the value of the convar. The client only uses a local version of the var that is set from console, which is not what I want because I want I to be retrieving the server’s version.


local brightness = GetConVar("re_lbrightness"):GetFloat()

Any help with retrieving a server side convar from client would be great.

Tested it and it works for me…

This code only works on single player and peer to peer connections, which this is not meant for. On dedicated servers is where this problem appears.

Flags aren’t set as extra arguments, they either need to be a bit field or inside a table.

It worked, thanks!