Just as a quick shitty example of a printer (not tested due to writing this straight into the TTG reply box but you should get the general idea)
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "MyPrinter"
ENT.Author = "Deano"
ENT.Contact = "MyContactInfo"
ENT.Purpose = "Purpose"
ENT.Instructions = "Spawn in Q menu. Press E to take money out"
ENT.Spawnable = true
ENT.AdminSpawnable = true
local amount = 0
local regenAmount = 10
local regenTime = 10
local lastRegenTime = CurTime()
if ( SERVER ) then
util.AddNetworkString( "PrinterMessage" )
self:SetModel( "MyModel.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
local phys = self:GetPhysicsObject()
if ( phys:IsValid() ) then
function ENT:SpawnFunction( ply, tr, ClassName )
if ( !tr.Hit ) then return end -- If the player isn't aiming anywhere that we can place the entity, don't spawn it
owner = ply -- Set whoever spawned it in to be the owner
local spawnPos = tr.HitPos + tr.HitNormal * 10 -- Spawn the entity a short distance away from the player
local spawnAng = ply:EyeAngles() -- Where is the player aiming towards
spawnAng.p = 0 -- Reset the pitch of the entity (so it is placed flat)
spawnAng.y = spawnAng.y + 180 -- Make the entity face the player
local ent = ents.Create( ClassName ) -- Create an instance of the entity
ent:SetPos( spawnPos ) -- Set the spawn position
ent:SetAngles( spawnAng ) -- Set the angle
ent:Spawn() -- Spawn it into the world
ent:Activate() -- Activate it to apply physics
function ENT:Use( activator, caller )
if ( activator:SteamID64() == owner:SteamID64() ) then -- the person interacting is the owner
local balance = owner:getDarkRPVar( "balance" ) -- Get their current DarkRP balance
owner:setDarkRPVar( "balance", balance + amount ) -- Increase their balance
net.Start( "PrinterMessage" ) -- Send a chat message that they've received the money
net.WriteString( "You have gained " .. amount .. "!" )
net.Send( owner )
amount = 0 -- reset the current amount in printer
net.Start( "PrinterMessage" ) -- Tell non-owners to bugger off!
net.WriteString( "This is not your printer!" )
net.Send( activator )
if ( CurTime() > lastRegenTime + regenTime ) then -- If the time has increased by *regenTime*, give them the *regenAmount* money
amount = amount + regenAmount
net.Receive( "PrinterMessage", function( len, ply ) -- Print message to player chat
local msg = net.ReadString()
chat.AddText( msg )
You'll have to forgive the syntax highlighting as TTG defaults to C-based but I don't know how to change it to be lua.
Provided that you have DarkRP installed, you should be able to find a printer entity in there by default and should just copy and paste the files (whilst changing the name too) and then change the values within the new printer files;
The guide linked below is an old example but should be pretty useful if you want to make a fully customised printer