Help a Lua n00b out, please :3

Well, this would be “my first SWEP” if you count building upon someone else’s add-on with other add-ons… If that makes sense… :confused: Anyways, how would I be able to use my reload button as a cycler of different actions? Like:
[LUA]function SWEP:SecondaryAttack()
if (SERVER) then
if self.Owner:KeyDown(IN_USE) then
if self.onotherone then
self:SetWeaponHoldType(“normal”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Hands by your side” )
self.onotherone = false
else
if self.Holdtypecycle == 1 then
self:SetWeaponHoldType(“pistol”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Pistol/357” )
elseif self.Holdtypecycle == 2 then
self:SetWeaponHoldType(“melee”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Crowbar/Melee” )
elseif self.Holdtypecycle == 3 then
self:SetWeaponHoldType(“crossbow”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Shotgun/Crossbow” )
elseif self.Holdtypecycle == 4 then
self:SetWeaponHoldType(“ar2”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Smg/AR2” )
elseif self.Holdtypecycle == 0 then
self:SetWeaponHoldType(“normal”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Hands by your side” )
end
self.onotherone = true
end[/LUA]
I need it to select between just a couple different functions, I guess… And how would I be able to make a function non-toggled? Like, you have to hold it down for it to work? :3 If you need more info, I’ll be haunting this thread 14/7 And that code is from the Machinima hands addon. It had what I needed so I tried to use it, but I dunno how to change it…

[lua]
self.Holdtypecycle = 0

function SWEP:SecondaryAttack()
if SERVER then
if( self.Holdtypecycle>4 ) { self.Holdtypecycle = 0 } else { self.Holdtypecycle = self.Holdtypecycle +1 }
if self.Holdtypecycle == 1 then
self:SetWeaponHoldType(“pistol”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Pistol/357” )
elseif self.Holdtypecycle == 2 then
self:SetWeaponHoldType(“melee”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Crowbar/Melee” )
elseif self.Holdtypecycle == 3 then
self:SetWeaponHoldType(“crossbow”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Shotgun/Crossbow” )
elseif self.Holdtypecycle == 4 then
self:SetWeaponHoldType(“ar2”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Smg/AR2” )
elseif self.Holdtypecycle == 0 then
self:SetWeaponHoldType(“normal”)
self.Owner:PrintMessage( HUD_PRINTCENTER, “Hands by your side” )
end
end
end
[/lua]

I believe this is what your looking for, but I could be wrong…

Would it be possible to add multiple functions to a single button with the “elseif” command?