Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ENT:Use(Player, Caller)
- if self:GetNetworkedInt("StoredPrinters") == 0 then return end
- for Index = 1, self.MaxPrinters do
- if self:GetNetworkedInt("StoredPrinter" .. Index) ~= 0 then
- if IsValid(self.Contents[Index]) then
- self.Contents[Index]:SetPos(self:GetPos() + Vector(0, 0, (Index - 1) * 8))
- --touchedent:Spawn()
- self.Contents[Index]:SetCollisionGroup(0)
- self.Contents[Index]:SetNoDraw(false)
- self.Contents[Index]:SetMoveType(6)
- --Entity.sound:Stop()
- --Printer:SetNWInt("PrintA", self:GetNetworkedInt("StoredMoney" .. Index))
- end
- end
- end
- self:Remove()
- end
- function ENT:StartTouch(Entity)
- self.Contents = self.Contents or {}
- if Entity:IsValid() == true and Entity:IsOnFire() == false and self:GetNetworkedInt("StoredPrinters") < self.MaxPrinters then
- for PrinterIndex, PrinterClass in ipairs(self.Printers) do
- if Entity:GetClass() == PrinterClass then
- self:SetNetworkedInt("StoredPrinter" .. self:GetNetworkedInt("StoredPrinters") + 1, PrinterIndex)
- --self:SetNetworkedInt("StoredMoney" .. self:GetNetworkedInt("StoredPrinters") + 1, Entity:GetNWInt("PrintA"))
- self:SetNetworkedInt("StoredPrinters", self:GetNetworkedInt("StoredPrinters") + 1)
- table.insert(self.Contents, touchedent)
- Entity:SetNoDraw(true)
- Entity:SetCollisionGroup(20)
- Entity:SetMoveType(0)
- Entity.sound:Stop()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement