How to check if a wire input is connected ? [ ENT.Inputs["Name"].Value ]

Hi forum,

As i was coding my SEnt i’ve got Wiremod and Numpad inputs.

My dilemma is like:



function GetInput(Name)
      local Value = 0
      if ( my Wire input is connected )
              --I have to ignore the Numpad and use Wire
              Value = Ent.Inputs[Name].Value
      else  
               --Numpad only and ignore Wire
              Value is modifyed in a Numpad event
      end
      return Value
end


How should i do that using WireLib maybe, because its visible everywhere.

Can i use “Connected” Table from “WireLib.CreateSpecialOutputs” like so:



if( not Ent.Inputs["InputName"].Connected ) then
    // Ent.Inputs["InputName"].Connected == nil ...
    // Some Code Here
end


Regards DVD !