• cant buy custom money printers after they explode
    6 replies, posted
I have 2 new custom money printers on my server and after they explode you are unable to purchase them again without reconnecting how can i fix this bug.
Care to show us the code?
[img]http://episteme.arstechnica.com/eve/forums/a/ga/ul/141004462041/inlineimg/Y/office-space-printer-smash.jpg[/img]
I'm gonna knock bigwaffle out
[QUOTE=Kidd;20995166]Care to show us the code?[/QUOTE] [CODE] -- RRPX Money Printer reworked for DarkRP by philxyz AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") function ENT:Initialize() self:SetModel("models/props/CS_militia/microwave01.mdl") self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_VPHYSICS) self:SetSolid(SOLID_VPHYSICS) local phys = self:GetPhysicsObject() if phys:IsValid() then phys:Wake() end self.sparking = false self.damage = 100 self.IsMoneyPrinter = true timer.Simple(30, self.CreateMoneybag, self) end function ENT:OnTakeDamage(dmg) if self.burningup then return end self.damage = self.damage - dmg:GetDamage() if self.damage <= 0 then local rnd = math.random(1, 4) if rnd < 3 then self:BurstIntoFlames() else self:Destruct() self:Remove() end end end function ENT:Destruct() local vPoint = self:GetPos() local effectdata = EffectData() effectdata:SetStart(vPoint) effectdata:SetOrigin(vPoint) effectdata:SetScale(1) util.Effect("Explosion", effectdata) Notify(self:GetNWEntity("owning_ent"), 1, 4, "Your money printer has exploded!") end function ENT:BurstIntoFlames() Notify(self:GetNWEntity("owning_ent"), 1, 4, "Your money printer is overheating!") self.burningup = true local burntime = math.random(8, 12) self:Ignite(burntime, 0) timer.Simple(burntime, self.Fireball, self) end function ENT:Fireball() local dist = math.random(1800, 2000) -- Explosion radius self:Destruct() for k, v in pairs(ents.FindInSphere(self:GetPos(), dist)) do if not v:IsPlayer() and not v.IsMoneyPrinter then v:Ignite(math.random(5, 22), 0) end end self:Remove() end local function PrintMore(ent) if ValidEntity(ent) then ent.sparking = true timer.Simple(3, ent.CreateMoneybag, ent) end end function ENT:CreateMoneybag() if not ValidEntity(self) then return end if self:IsOnFire() then return end local MoneyPos = self:GetPos() if math.random(1, 5) == 3 then self:BurstIntoFlames() end local moneybag = ents.Create("prop_physics") moneybag:SetModel("models/props/cs_assault/money.mdl") moneybag.ShareGravgun = true moneybag:SetPos(Vector(MoneyPos.x + 15, MoneyPos.y, MoneyPos.z + 15)) moneybag.nodupe = true moneybag:Spawn() moneybag:GetTable().MoneyBag = true local amount = GetGlobalInt("mprintamount") if amount == 0 then amount = 2000 end moneybag:GetTable().Amount = amount self.sparking = false timer.Simple(math.random(100, 350), PrintMore, self) end function ENT:Think() if not self.sparking then return end local effectdata = EffectData() effectdata:SetOrigin(self:GetPos()) effectdata:SetMagnitude(1) effectdata:SetScale(1) effectdata:SetRadius(2) util.Effect("Sparks", effectdata) end [/CODE] I got it, I'm the one who edited the code so I'll post it, here it is. (Above obviously)
did you try manually saying something like ply.MoneyPrinters, and then just simply decrementing it?
you gotta add the function in cl_init and sv_gamemode_functions
Sorry, you need to Log In to post a reply to this thread.