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.
[CODE]
local amount = printerConfig.bronzePrintAmnt
if self:GetMoney() < 18000 then
self:SetMoney( self:GetMoney() + amount )
else
DarkRP.notify( ply, 0, 5, "Your bronze printer is full" )
end
[/CODE]
where's [lua]ply[/lua] defined?
[QUOTE=Fruitwesp;51407227]where's [lua]ply[/lua] defined?[/QUOTE]
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: [url]https://github.com/FPtje/DarkRP/blob/master/entities/entities/money_printer/init.lua#L69[/url]
Or if you're really fixated on using ply as the entity just implement one line of code before you use it..
[code]
local ply = self:Getowning_ent()
[/code]
[QUOTE=Fruitwesp;51407280]The owner is already set. Replace this [lua]ply[/lua] with this [lua]self:Getowning_ent()[/lua]
Example reference: [url]https://github.com/FPtje/DarkRP/blob/master/entities/entities/money_printer/init.lua#L69[/url][/QUOTE]
That worked. Thanks for the help!
Sorry, you need to Log In to post a reply to this thread.