Payday Notification Adding

Hey everyone. So I have Chief’s Money System to test out some things and I was looking for a way to add notifications on every payday. I tried some things that maurits.tv had like Add.Notify but that didnt work. If anyone could give a hand on making payday notifications, it would be much appreciated.

I tried this and it didnt work as expected since Notify doesnt exist.


function payday_notify()
	for k, v in pairs(player.GetAll()) do
		if ply:Money_Add( PAYDAY_AMOUNT ) then
					v:Notify("Payday! Take your money scumbag.")
					return
		end
	end
end

Each and every different gamemode usually has a different way of doing notifies. Can you tell us which gamemode this is for?

A custom one. Im totally lost on this.

Is it derived from sandbox?

Yes it is

Looks like this is the correct way of using it.

[ERROR] gamemodes/thisthing/gamemode/init.lua:127: attempt to call method ‘AddNotify’ (a nil value)

  1. unknown - gamemodes/thisthing/gamemode/init.lua:127

And new code:


if PAYDAYS then
	timer.Create( "payday_timer", PAYDAY_INTERVAL, 0, function()
		for k, ply in pairs(player.GetAll()) do
			ply:Money_Add( PAYDAY_AMOUNT )
			if PAYDAY_NOTIFY then
				GAMEMODE:AddNotify("Payday!.", NOTIFY_GENERIC, 5)
			end
			if PAYDAY_SOUND then
				ply:EmitSound("tools/ifm/beep.wav")
			end
		end
	end )
end

Please tell me if this was made right or not.

try [lua] ply:AddNotify(“Payday!.”, NOTIFY_GENERIC, 5)[/lua]

Still getting this.

[ERROR] gamemodes/thisthing/gamemode/init.lua:127: attempt to call method ‘AddNotify’ (a nil value)

  1. unknown - gamemodes/thisthing/gamemode/init.lua:127

Timer Failed! [payday_timer][@gamemodes/thisthing/gamemode/init.lua (line 123)

AddNotify is clientside.

Well i put it clientside with this code


	if PAYDAY_NOTIFY then
		for k, ply in pairs(player.GetAll()) do
			if ply:AddMoney( PAYDAY_AMOUNT ) then
				ply:AddNotify("Payday!.", NOTIFY_GENERIC, 5);
					return
			end
		end
	end

and nothing happened… I dont know what else to do.