Hello, I'm trying to change a value when a checkbox is checked. I would also want it to change to another value if it's UNchecked. I already tried DCheckBoxLabel.GetChecked, but it doesn't work..
Mind posting the part of code of what you have tried?
My Checkbox (cl_init.lua):
[code]
M4:SetText( "M4" )
M4:SizeToContents()
ARCatProp:AddItem(M4)
M4:SetContents(ARCatProp)
if AR:GetChecked() then
local pend_m4 = 1
else
local pend_m4 = 0
end
[/code]
My pend_m4 function called by the console command (init.lua):
[code]
function pend_m4(ply)
if pend_m4 == 1 then
ply:Give("weapon_mad_m4")
else
ply:StripWeapon("weapon_mad_m4")
end
end
[/code]
[editline]18th August 2013[/editline]
Nevermind, It was because i had to check it with a button.
Sorry, you need to Log In to post a reply to this thread.