[Help] With getting convars


I want to make a script that will get the convar and do if.

Example a script that gets the convar “gm_someconvar 200”

So the script will be: if convar “gm_someconvar = 200”
print (“The Convar is 200 !”)
print (“The convar is not 200”)

I know this is stupid… but i really need this

Here’s a very basic tutorial on the subject: https://dl.dropboxusercontent.com/u/26074909/tutoring/convars/creating_and_using_client_convars.lua.html

They do return when you create, so it is possible to use the assigned var, or the convar name to get the convar and, in turn, the value.

Hopefully it helps.

It does not help me because i’m a lua noob…
the only thing i’ve managed to do is to print the convar
local getit = GetConVar(“physgun_test”):GetInt()

local convar = GetConVar( “physgun_test” ):GetInt()
if convar == 200 then – == is “equal to”
print( “convar is 200” )
else – will run if the previous condition(s) is/are not met
print( “convar is not 200” )

In the future you should surround you code with:
(minus the !'s)

Thanks !