AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include('shared.lua') -- Move the key bindings away from the mouse so you can use left and right click to shoot gun ENT.ForwardKey =IN_FORWARD ENT.FastForwardKey =IN_WALK ENT.BackwardKey =IN_BACK ENT.RollLeftKey =IN_MOVELEFT ENT.RollRightKey =IN_MOVERIGHT ENT.HoverKey =IN_SPEED function ENT:SpawnFunction( ply, tr) local SpawnPos = tr.HitPos + tr.HitNormal * 100 local ent = ents.Create( "shuttle_wire" ) ent:SetPos( SpawnPos ) ent:Spawn() ent:Activate() return ent end function ENT:Initialize() self.BaseClass.Initialize(self) self.Outputs=Wire_CreateOutputs(self.Entity,{"Reload","Hovering","Speed","RollAmt","Health","Attack1","Attack2"}) -- Detaults Wire_TriggerOutput(self.Entity, "Reload", 0) Wire_TriggerOutput(self.Entity, "Hovering", 0) Wire_TriggerOutput(self.Entity, "Attack1", 0) Wire_TriggerOutput(self.Entity, "Attack2", 0) end -- This function is a great place to do custom processing (like this wire stuff) as it's run after everything important is done. You could also do weapons and so on here. function ENT:ProcessCustom() if ValidEntity(self.Pilot) then Wire_TriggerOutput(self.Entity, "Reload", tonumber(self.Pilot:KeyDown(IN_RELOAD))) Wire_TriggerOutput(self.Entity, "Hovering", tonumber(self.Pilot:KeyDown(self.HoverKey))) Wire_TriggerOutput(self.Entity, "Attack1", tonumber(self.Pilot:KeyDown(IN_ATTACK))) Wire_TriggerOutput(self.Entity, "Attack2", tonumber(self.Pilot:KeyDown(IN_ATTACK2))) end Wire_TriggerOutput(self.Entity, "Speed", self.Accel) Wire_TriggerOutput(self.Entity, "RollAmt", self.Roll) Wire_TriggerOutput(self.Entity, "Health", self:GetxHealth()) end