dark rp notify not working

Hi, Im trying to make it so that when your printer gets to a certain amount it sends a notification to you that its full. The script works because it does stop printing however it doesn’t notify the user.

local amount = printerConfig.bronzePrintAmnt
if self:GetMoney() < 18000 then
     self:SetMoney( self:GetMoney() + amount )
     DarkRP.notify( ply, 0, 5, "Your bronze printer is full" )

where’s [lua]ply[/lua] defined?

I thought it was defined by default as the player in darkrp (im just starting to learn lua). How would I define it as the owner of the printer

The owner is already set. Replace this [lua]ply[/lua] with this [lua]self:Getowning_ent()[/lua]

Example reference: https://github.com/FPtje/DarkRP/blob/master/entities/entities/money_printer/init.lua#L69

Or if you’re really fixated on using ply as the entity just implement one line of code before you use it…

local ply = self:Getowning_ent()

That worked. Thanks for the help!