Notify player

I have an entity that once you press use on it, it should give you the X amount cash + notify the player. But the problem is that the player dont get the notify message. Any1 see something wrong here?

[lua]
function ENT:Use( activator, caller )
activator:AddMoney( self.Entity:GetNWInt(“money”) )
self.Entity:SetNWInt(“money”, 0)

if self.Entity:GetNWInt("money") > 0 then 
Notify(activator "You got " .. self.Entity:GetNWInt("money") .. " from the money printer!") end

end
[/lua]

is Notify a declared function? Why not use activator:PrintMessage()? **[Player.PrintMessage

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Player.PrintMessage)
**
Edit: I am also quite sure you can’t really give this as an argument:activator “You got …”

Either concatenate the strings or put a ‘,’ in between them if they are 2 arguments.

Also your checking if the entities money > 0, but 1 line before that you have set it to 0. So the user will never get the notification.

well the self.Entity:SetNWInt(“money”, 0) is reseting the money after its taken out of the printer tho… How would you guy have done this then?

[lua]function ENT:Use( activator, caller )
activator:AddMoney( self.Entity:GetNWInt(“money”) )
activator:PrintMessage(HUD_PRINTTALK, “You got " … self.Entity:GetNWInt(“money”) … " from the money printer!”)
self.Entity:SetNWInt(“money”, 0)
end
[/lua]

Yeah, but by not having the > 0, i get this message everytime i click on the entity when theres no cash inside it.

[lua]function ENT:Use( act, cal )
local money = self.Entity:GetNWInt(“money”);
if( money > 0 )then
act:AddMoney( money );
umsg.Start(“NotifyPlayer”, act)
umsg.String(“You got " … money … " from the money printer!”);
umsg.End()
end;
end;[/lua]

Client:
[lua]usermessage.Hook(“NotifyPlayer”, function(um)
local text = um:ReadString();
print(text);
GAMEMODE:AddNotify(text , NOTIFY_GENERIC, 5);
end);[/lua]

How I would do it.

GM:AddNotify is sandbox and derivatives only

Also:

[lua]
function ENT:Use( activator, caller )
if self.Entity:GetNWInt(“money”) > 0 then
activator:AddMoney( self.Entity:GetNWInt(“money”) )
activator:PrintMessage(HUD_PRINTTALK, “You got " … self.Entity:GetNWInt(“money”) … " from the money printer!”)
self.Entity:SetNWInt(“money”, 0)
end
end
[/lua]

I didn’t think someone who can’t show a notification message will derive from base and do all the base coding himself…
I assumed he was deriving from sandbox.

-snip- tired nvm

I solved the problem. Notify is a function. i just forgot to add 2 word in the code. Thanks anyway guys:)