View Single Post
04/15/14, 03:37 PM   #6
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Iyanga View Post
Your first snippet:
Lua Code:
  1. function toghelm()
  2. local control = ZO_OptionsWindow.controlTable[3][8]
  3. SetSetting(control.system, control.settingId, (var))
  4.     var = x
  5.         if x == 0 then return nohelm()
  6.         elseif x == 1 then return helm()
  7.     end
  8.  
  9. end


There is no x. If there is no x, it is nil. If x is nil, then the comparisons are "nil == 0" which is false and "nil == 1" which is also false. Neither helm() nor norhelm() gets executed.
I guess there should be x = var instead of var = x.
  Reply With Quote