Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ENT.Type = "anim";
- ENT.Base = "ce_base";
- ENT.PrintName = "Or Gate";
- ENT.Author = "Aska";
- ENT.Purpose = "Outputs when any one of its inputs are triggered";
- ENT.Category = "Check em";
- ENT.skin = "or";
- ENT.Spawnable = false;
- ENT.AdminSpawnable = false;
- ENT.HasCustomMenu = true;
- ENT.LimitInputs = {2, 10};
- if (SERVER) then
- AddCSLuaFile("shared.lua");
- function ENT:Initialize()
- self.BaseClass.Initialize(self);
- self:SetNumInputs(2);
- end
- function ENT:CheckInputs()
- for k, v in ipairs(self.Inputs) do
- if (v[1] == true) then //one of our inputs says yes...
- return true; //...so we're good to go
- end
- end
- return false;
- end
- function ENT:Output()
- return self:CheckInputs();
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement