Entity spawning problem.

So if i try to do ulx ent moneyprinter it just says it doesnt exists.

I have no idea why and yes its placed at lua/entities/

[LUA]
/---------------------------------------------------------------------------
Serverside
---------------------------------------------------------------------------
/
AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)
include(“shared.lua”)

CoolerPrice = 500
BatteryPrice = 300

util.AddNetworkString(“printer_cooler”)
util.AddNetworkString(“printer_battery”)
util.AddNetworkString(“getcoolerkey”)

function ENT:Initialize()
self:SetModel(“models/props_c17/consolebox01a.mdl”)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
phys:Wake()

self.IsMoneyPrinter = true
self:SetCooler() = 0
self:SetHeat()  = 29
self:SetBattery() = 0

timer.Simple( PrintTime, function() PrintMoney(self) end)

self.sound = CreateSound(self, Sound("ambient/levels/labs/equipment_printer_loop1.wav"))
self.sound:SetSoundLevel(52)
self.sound:PlayEx(1, 100)

end

function ENT:OnTakeDamage(dmg)

self:Heat() = (self:Heat() or 70) + dmg:GetDamage()

end

function ENT:Think()

if self:Cooler() == 1 and self:GetHeat() <= 28 and self:GetHeat() != >= 71 or self:Battery() == 0 then
timer.Simple( 8, function()
self.AddHeat( -1 )
end)
elseif self:Cooler() == 0 and self:GetHeat() >= 28 and self:GetHeat() != >= 71 and self:Battery() == 1 then
timer.Simple( 6, function()
self.AddHeat( 1 )
end)
end

 if self:Heat() &gt;= 70 then
	self.Destruct()
	self.Remove()
else
	return false
end
 if self:WaterLevel() &gt; 0 then
	self:Destruct()
	self:Remove()
	return
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)
DarkRP.notify(self:Getowning_ent(), 1, 4, DarkRP.getPhrase(“money_printer_exploded”))
end

function PrintMoney(ent)

if self:Battery() == 0 or self.CPUKey = nil then
	return false
end
else
	timer.Simple( 1.5, function()
	self:SetNWString("MoneyInside", self:GetNWString("MoneyInside") +  )
	PrintMoney(self)
end)

end

function ENT:Use(ply)

if ply:IsPlayer() and and  self:GetNWString("MoneyInside") &gt; 0 then

	ply:addMoney(self:GetNWString("MoneyInside"))
	self:SetNWString("MoneyInside", 0)
end

end

function ENT:OnRemove()

if self.sound then
	self.sound:Stop()
end

end

net.Recieve( “getcoolerkey”, function( length, ply )

	self.CPUName = length
	ply:addMoney (-CPU[Price])

end

net.Recieve( “printer_cooler”, function( length, ply )

ply:addMoney( -CoolerPrice )
self:SetCooler() = 1
timer.Simple( 420, function()
	self:SetCooler() = 0
end)

end

net.Recieve( “printer_battery”, function( length, ply )

ply:addMoney( -BatteryPrice )
self:SetBattery() = 1
timer.Simple( 300, function()
	self:SetBattery() = 0
end)

end

/*
button1.Click = function()
net.Start(“getcoolerkey”)
net.WriteString(“AMD A4-5300”)
net.SendToServer()
end
*/
[/LUA]

Would be nice if you could point out what could be wrong

What exactly are you trying to do with ULX?

  • Title answered that.

Are you sure ULX can spawn ents with a command? Just add your entity to the spawn menu, or F4 menu if you use DarkRP.

I have



DarkRP.createEntity("Custom Money Printer", {
        ent = "moneyprinter",
        model = "models/props_c17/consolebox01a.mdl",
        price = 10,
        max = 2,
        cmd = "buycmoneyprinter",
})

It gives an error and refers to this code in the modules/base in DarkRP.

It says that dt = nil.


item.dt.owning_ent = ply

Line 398 in modules/base/sh_createitems.lua

Well it says “dt” because it cant find matching entity, try check the location for the printer is it in modification addon for DarkRP?

Add Djarthas on steam.