Will anyone here help me to figure out how to make this money printer not explode?
[url]http://www.garrysmod.org/downloads/?a=view&id=121648[/url]
Thanks in advance!
what?
I want this money printer *points to link* to not explode at all.
what do you mean? like the ability to not destroy it or does it just blow up when you spawn it or what?
Like, I don't want it to overheat.
Hmm..since I dont have the download,I'll need more specifics. Do you mean it explodes after you print to much money?
Exactly that.
Might be a specific reason for that. Could be the fact the download itself dosen't wont you to print to much, or could be server specific
Also have you just tried spawning another one?
Well you know how some servers money printers will explode on random? (Guess I should have said this instead.) I want this printer to not explode unless shot at.
just edit the printer's lua file
-you damn ninjas-
[QUOTE=ExplosiveCheese;31640939]just edit the printer's lua file[/QUOTE]
Yes, I know I have to edit the init.lua file. I just don't know what part of it makes the printer explode at random.
[b]To remove the explosion damage[/b](I guess you mean that it ignites and kills everything around the printer) do the following:
Open init.lua
replace
[lua]
function ENT:Fireball()
if not self:IsOnFire() then return end
local dist = math.random(20, 280) -- 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
[/lua]
At line 54
with
[lua]
function ENT:Fireball()
self:Remove()
self:Destruct() --remove this line, if you want to remove the Explosion effect
end
[/lua]
I haven't tested it, so I can't tell if it works.
EDIT:
[b]If you want it to be unable to be destroyed by players[/b], remove the following code at line 21:
[lua]
function ENT:OnTakeDamage(dmg)
if self.burningup then return end
self.damage = (self.damage or 100) - dmg:GetDamage()
if self.damage <= 0 then
local rnd = math.random(1, 10)
if rnd < 6 then
self:BurstIntoFlames()
else
self:Destruct()
self:Remove()
end
end
end
[/lua]
EDIT2:
[b]If you want to remove the random chance for it to blow up randomly[/b], remove the line at 90:
[lua]
if math.random(1, X) == 3 then self:BurstIntoFlames() end
[/lua]
[QUOTE=kaukassus;31643970][b]To remove the explosion damage[/b](I guess you mean that it ignites and kills everything around the printer) do the following:
Open init.lua
replace
[lua]
function ENT:Fireball()
if not self:IsOnFire() then return end
local dist = math.random(20, 280) -- 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
[/lua]
At line 54
with
[lua]
function ENT:Fireball()
self:Remove()
self:Destruct() --remove this line, if you want to remove the Explosion effect
end
[/lua]
I haven't tested it, so I can't tell if it works.
EDIT:
[b]If you want it to be unable to be destroyed by players[/b], remove the following code at line 21:
[lua]
function ENT:OnTakeDamage(dmg)
if self.burningup then return end
self.damage = (self.damage or 100) - dmg:GetDamage()
if self.damage <= 0 then
local rnd = math.random(1, 10)
if rnd < 6 then
self:BurstIntoFlames()
else
self:Destruct()
self:Remove()
end
end
end
[/lua]
EDIT2:
[b]If you want to remove the random chance for it to blow up randomly[/b], remove the line at 90:
[lua]
if math.random(1, X) == 3 then self:BurstIntoFlames() end
[/lua][/QUOTE]
Thanks kaukassus, but LuaChobo did do it for me already. :p
Sorry, you need to Log In to post a reply to this thread.