LUA DarkRP Moneyprinter Help

Hello Community i have a question (sry for my bad english)

So i want to make a Custom Moneyprinter with only One Function it doesent Self Destroy

pls Help me

–Slowmag

Do you really need us to teach you how to edit one function?

Sure thing mate. Delete line:: 19 and 32. And replace it with

[lua]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, 1000)
	if rnd < 3 then
		self:BurstIntoFlames()
	else
		self:Destruct()
		self:Remove()
	end
end

end[/lua]

It is untested. But it might work… Enjoy.

And Another Question about LUA

I didnt have on My Server a Banksystem (ATM)

anywhere can Script a ATM ?? i need it pls help and thanks Nexusowner for good answer.

http://www.facepunch.com/threads/1056910-DarkRP-Bank-system-v2.0-DARKRP-MODULE

Haha no problem man. Here is a awesome Bank system for DarkRP. http://www.facepunch.com/threads/1056910-DarkRP-Bank-system-v2.0-DARKRP-MODULE

Enjoy.

EDIT
My Mates internet were laggy so i didn’t notice Shadow posted that…
Fuck you :stuck_out_tongue:

Hey Thanks its very cool but i test it and when i play 5 minutes or what

then come Interest in a Number 10000 its very big i dont wont Interest never how i can delete this pls help
–Slowmag

And another Question

How can i make that the ATM they i have download

place on the Map so the ATM wants to go to there place when i make a server restart my Spawned ATM´s are away i dont know pls help!!!

What?

http://www.facepunch.com/threads/931152-What-do-you-need-help-with-V1

What ???

[editline]12th February 2011[/editline]

I want thats the ATM Stay on the Map

I guess you are talking about when you “Restart” your game server you want it to stay on. Example: Rp_downtown_v2. Then go under

http://img696.imageshack.us/img696/2781/cmdline.png

Command Line Changer.

Right after you are under that Press the button: New.

In the box above everything type map. Set the default start map to Rp_Downtown_v2

http://img152.imageshack.us/img152/1921/12345mzo.jpg

And every time you “Restart” Your server it would be on the current map you have putted in. I hope that was what you meant. Enjoy :slight_smile:

hmm not this i can make thats the Map stay but i want Add a entinity = ATM

in the Server it will be Save ok its stay 24/7 on the Server i cant this pls help

You want a Entity to stay on the map, like a Moneyprinter keep being on the server until restart?

Yes man thats it

I just made a new Custom printer for you, just replace your whole:: Init.lua with this

[lua]AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)
include(“shared.lua”)

function ENT:Initialize()
self:SetModel(“models/props_lab/reciever01a.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 = 200
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, 5)
	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.dt.owning_ent, 1, 4, “Your Homemade Money Printer has exploded!”)
end

function ENT:Fireball()
if not self:IsOnFire() then return end
local dist = math.random(30, 300) – 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(1, 5), 0) end
end
self:Remove()
end

local function PrintMore(ent)
if ValidEntity(ent) then
ent.sparking = true
timer.Simple(1, 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()

local amount = 125
if amount == 0 then
	amount = 125
end

DarkRPCreateMoneyBag(Vector(MoneyPos.x + 15, MoneyPos.y, MoneyPos.z + 15), amount)
self.sparking = false
timer.Simple(math.random(100, 400), 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[/lua]

[editline]13th February 2011[/editline]

And by the way, this will cause alot of lag on your server. Because if you place a moneyprinter example a weird place it keeps producen moneyprinters. And once you come on the server you have to look for the printer or restart.

Yea Thanks but i want to make the ATM Stay on Map not The Money printer

The URl for the ATM System i use : http://www.facepunch.com/threads/105…-DARKRP-MODULE

so pls Help!! =)

Wth? Do you mean a World prop?

No A Entity in the Entity list thats the ATM i want that thing stay on the Map

Serious i don’t get a word of what you are saying.

[lua]

local amount = 125
if amount == 0 then
amount = 125
end

[/lua]
Why are you checking if amount is 0 if the amount was set to 125 before ?
[lua]
function ENT:CreateMoneybag(amount)
if(!ValidEntity(self) || self:IsOnFire()) then return end
local MoneyPos = self:GetPos()

if(!amount || amount <= 0) then
    amount = math.random(100, 150) 
end

DarkRPCreateMoneyBag(Vector(MoneyPos.x + 15, MoneyPos.y, MoneyPos.z + 15), amount) 
self.sparking = false 
timer.Simple(math.random(100, 400), PrintMore, self) 

end
[/lua]