Money Printer For DarkRP

Can someone please make me a money printer for darkrp.I tried to make it but it did not work.Can some one help me I am a complete noob at lua.
I understand very little so can some one help ?

Look inside RRPX :slight_smile:

I did that but how do I get it to work with the new darkrp? I can’t get the chat command to work.


I want to add that when a cop spawns he has a swep.He has the Tranquilizer gun and not a real gun

link to the swep is here


ok I got the Tranquilizer gun to work and made it so cops have it at start

but I just can get the money printer to work this is what I did

1 - I added the the entity “money_printer” from “RRPX” in to DarkRP\entities\entities

2 - I added this to line 847 in to the “rplol.lua” file

function MakeMprinter( ply )
local trace = { }
–if( args == “” ) then return “”; end
trace.start = ply:EyePos();
trace.endpos = trace.start + ply:GetAimVector() * 85;
trace.filter = ply;
if( ply:GetTable().Arrested ) then return “”; end
local tr = util.TraceLine( trace );
if( not tr.Entity:IsValid() and tr.Entity ~= “craftingtable”) then
Notify( ply, 1, 4, “Must be looking at your crafting table and close enough!” )
return “”;
if tr.Entity:GetNWEntity(“ownu”) ~= ply then
Notify( ply, 1, 4, “That’s not your crafting table!” )
return “”;
if( ply:Team() ~= 16 and ply:Team() ~= 31 ) then
Notify( ply, 1, 4, “Must be a Crafter!”)
return “”;
if( ply:GetTable().Arrested ) then return “”; end

if( not ply:CanAfford( GetGlobalInt("mprintercost") / 2 ) ) then
	Notify( ply, 1, 3, "Cannot afford this" );
	return "";
if(ply:GetNWInt("maxmprinters") == CfgVars["maxmprinters"])then
	Notify( ply, 1, 3, "Max Money Printers Reached!" );
	return "";
ply:AddMoney( GetGlobalInt("mprintercost") / 2 * -1 );
Notify( ply, 1, 3, "You made a Money Printer for "..GetGlobalInt("mprintercost") / 2 .."!" );
local moneyprinter = ents.Create( "money_printer" );
moneyprinter:SetNWEntity( "ownu", ply );
local drugPos = tr.Entity:GetPos()
moneyprinter:SetPos(Vector(drugPos.x,drugPos.y,drugPos.z + 10))
return "";

AddChatCommand( “/makemoneyprinter”, MakeMprinter );

3 -I added this console commands in to rprofl.lua

SetGlobalInt(“mprintamount”, 250)
SetGlobalInt(“mprintercost”, 1000)

and in to init.lua i added this at line 235

CfgVars[“maxmprinters”] = 2;

4 - I added this to cl_init.lua to line 181
if( tr.Entity:GetClass() == “money_printer” ) then

			pos = LocalPlayer():GetEyeTrace().HitPos:ToScreen();
			draw.DrawText( "Money Printer", "TargetID", pos.x + 1, pos.y + 1, Color( 255, 255, 255, 200 ), 1 );



can someone please help me


any body please help me


here look this is what I did.Can you please look and tell me what I have to add or modify.

May I ask what version of Dark RP are you using?
There are so many other Dark RP updates done by different people than the original.

Then maybe I can take a look into this.

this is darkrp version 2.2.12 I think its the last one.I think

Don’t you mean 2.2.12?

function BuyMoneyPrinter(ply, args)
    if ply:GetTable().Arrested then return "" end
    local trace = {}
    trace.start = ply:EyePos()
    trace.endpos = trace.start + ply:GetAimVector() * 85
    trace.filter = ply
    local tr = util.TraceLine(trace)

    if not ply:CanAfford(GetGlobalInt("mprintercost") then
        Notify(ply, 1, 3, "Cannot afford this")
        return ""

    if ply:GetNWInt("maxmprinters") >= CfgVars["maxmprinters"] then
        Notify(ply, 1, 3, "Max Money Printers Reached!")
        return ""

    ply:AddMoney(GetGlobalInt("mprintercost") * -1)
    Notify( ply, 1, 3, "You bought a Money Printer for " .. GetGlobalInt("mprintercost") .. "!")
    local moneyprinter = ents.Create("money_printer")
    moneyprinter:SetNWEntity("ownu", ply)
    local drugPos = tr.Entity:GetPos()
    moneyprinter:SetPos(Vector(drugPos.x,drugPos.y,drugPos.z + 10))
    return ""
AddChatCommand("/moneyprinter", BuyMoneyPrinter)

so if i replace the line 847 in the file “rplol.lua” with this it will work ?

the coding did not work what have i done wrong ?

here is the money printer init.lua
– ============================================
– = =
– = Crate SENT by Mahalis =
– = =
– ============================================

function ENT:Initialize()
self.Entity:SetModel( “models/props_c17/consolebox01a.mdl”)
local phys = self.Entity:GetPhysicsObject()
if(phys:IsValid()) then phys:Wake() end
timer.Create( self.Entity, 180, 0, self.createMoneybag, self)
timer.Create( “Egg”, 3600, 0, self.Destruct, self)
timer.Create( “Egg2”, 3600, 0, self.Remove, self)
local ply = self.Entity:GetNWEntity( “ownu” )
ply:SetNWInt(“maxmprinters”,ply:GetNWInt(“maxmprinters”) + 1)
–timer.Create( self.Entity:EntIndex() … “moneybag”, 60, 1, self.createMoneybag, self )

function ENT:OnTakeDamage(dmg)
self.Entity:SetNWInt(“damage”,self.Entity:GetNWInt(“damage”) - dmg:GetDamage())
if(self.Entity:GetNWInt(“damage”) <= 0) then

function ENT:Destruct()

local vPoint = self.Entity:GetPos()
local effectdata = EffectData()
effect******SetStart( vPoint )
effect******SetOrigin( vPoint )
effect******SetScale( 1 )
util.Effect( "Explosion", effectdata )


–function ENT:Use(activator,caller)
– self.Entity:SetNWEntity( “usero”, activator )
– if( activator:GetNWInt(“maxmprint”) >= 5 ) then
– Notify( activator, 1, 3, “Printed Max Money” );
– else
– self.Entity:SetNWBool(“sparking”,true)
– timer.Create( self.Entity:EntIndex() … “moneybag”, 1, 1, self.createMoney, self )
– end

function ENT:createMoneybag()
local ply = self.Entity:GetNWEntity( “ownu” )
local userb = self.Entity:GetNWEntity( “usero” )
self.Entity:SetNWEntity( “usero”, ply )
if( ply:GetNWInt(“maxmprint”) >= 10 ) then
Notify( ply, 1, 3, “Printer jammed, try taking some money.” );
return “”;
local MoneyPos = self.Entity:GetPos()
local rnd1 = math.random(1, 22)
if(rnd1 == 3) then
Notify( ply, 1, 3, “Your money printer exploded!” );
–local moneybag = ents.Create( “prop_physics” );
–moneybag:SetPos( tr.HitPos );
–moneybag:GetTable().MoneyBag = true;
–moneybag:GetTable().Amount = amount;

	local moneybag = ents.Create("prop_physics")
	moneybag:SetModel( "models/props/cs_assault/money.mdl" );
	moneybag:SetPos(Vector(MoneyPos.x + 15,MoneyPos.y,MoneyPos.z + 15))
	moneybag:SetNWEntity( "ownu", userb )
	moneybag:SetColor( 175, 255, 175, 255 )
	moneybag:GetTable().MoneyBag = true;
	moneybag:SetNWEntity("ownu", ply )
	moneybag:GetTable().Amount = GetGlobalInt("mprintamount");


function ENT:Think()
if(self.Entity:GetNWBool(“sparking”) == true) then
local effectdata = EffectData()
effectSetOrigin( self.Entity:GetPos() )
SetMagnitude( 1 )
effectSetScale( 1 )
SetRadius( 2 )
util.Effect( “Sparks”, effectdata )

function ENT:OnRemove( )
local ply = self.Entity:GetNWEntity( “ownu” )
ply:SetNWInt(“maxmprinters”,ply:GetNWInt(“maxmprinters”) - 1)

I’ll release this tomorrow as a patch for DarkRP 2.2.12 for those that want it.

ok thanks man

Here it is. It’s a little more “fun” than the normal Money Printer but I’m sure you won’t mind. It needed some work anyway.

EDIT: Re-download it if you have a lua error; I made a typo in hints.lua

ok and thanks so much =D

No problema.


Update: Fixed version:

I made a soda machine that works its only bug is that the can spawns in the machine.How do I get it to spawn at a certain place ?

thanks for you files now I understand how do make them =D

Just make sure that when you spawn, the vector you are spawning at is offset. For example, to make something higher by 15 inches, it is:

Vector(x, y+15, z)

thanks now that works.

how do you add a message for the entity in f2 like you put for the money printer.

If only DarkRP was like this.

[lua]local ArmsDealer = DarkRP.CreateTeam(“Arms Dealer”);
ArmsDealer.DefaultHP = 100;
ArmsDealer.DefaultArmor = 100;

function ArmsDealer:Loadout()
local loadout = {};
– Gravgun, Physgun and Toolgun auto added depending on server variables.
loadout[1] = “weapon_pistol”;
loadout[2] = “weapon_keys”;
return loadout;

function ArmsDealer:OnSpawn(ply)

function ArmsDealer:OnDeath(ply, attacker)


[lua]function Awesome(ply, args)
if (DarkRP.GetTeam(ply) == “Arms Dealer”) then
ply:SetMoney(ply:GetMoney() + 9000 + 1);
DarkRP.NotifyAll(ply:Name()…" is awesome, Also THE GAME.");
DarkRP.Notify(ply, “You’re not an Arms Dealer!”);

– Only ‘awesome’ because prefix is auto added.
DarkRP.AddChatCommand(“awesome”, Awesome);[/lua]

Of course this would be a better approach instead of the hard coded shit. I love OOP, by the way. :slight_smile:

DarkRP will never be like that while I’m working on it, I simply can’t justify it due to the time it takes to test it all.

2.2.15 however has had some cleanup in terms of massive lists of if statements in favor of tables.

SeriousRP will be OOP but please bear in mind it is a MASSIVE task to change it all and I’m not going to do it twice.

Also, DarkRP was never designed to be a framework gamemode for people to just “easily” change with their own classes… if I added something like that you would then have another 10,000 threads asking why another area of the code isn’t like that and “how do I change the skins” and "I want to make it so that… " it would become a support nightmare because the demand to make it OO is so high that I’d just never stop making it more and more and more OO until all that’s left is Cakescript, which might seem to be a good thing but not DarkRP… I want SeriousRP to be able to do that. (Though I’m still not too happy about the idea of supporting everyone’s custom stuff added via OO when I can just support the core code) which is what will happen if it’s all OO

I love OO, too by the way but… there’s just SO MUCH code to go wrong.

I guess so, I’ll wait for SeriousRP.

I’ve removed most of the massive “if” blocks and replaced them with something smaller in DarkRP 2.2.15 beta (release coming in a few hrs) but I’ll make sure to do a proper job in SeriousRP and go as OO as I can :slight_smile: It’s just cleaner that way.

My goal with DarkRP 2.2 is stability and if I change too much in one go, that’s when the regressions start (like in 2.2.13 and 2.2.14)