Making a printer NET Error

I am trying to make a printer and I made a timer that every 10 seconds it will set moneyPrinted to moneyPrinted + some money. I want it to sent to client so client will know what to draw on the printer. Its not working



	timer.Create("printMoney",10,0,function() 
		self.moneyPrinted = self.moneyPrinted + math.random(4987, 6231)

		net.Start("sendMoney")
			net.WriteInt(self.moneyPrinted)
		net.Send(self)
	end)


ERROR



bad argument #2 to 'WriteInt' (number expected, got no value)


[editline]18th November 2017[/editline]

oh wait…

OMG I AM A IDIOT

[editline]18th November 2017[/editline]

well I figured out the WriteInt part(I forgot the second argument xDD) but the net message still wont send to client.

[editline]18th November 2017[/editline]

Im getting this now :



net.Send: Entity is not a player!


Can you show us what self refers to? And besides, you’d be better off using NetworkVars for this anyway.

And what is so funny?

This is a entity. I have init, shared, and cl_init .lua and I am trying to use Net messages to send the variable (self.moneyPrinted) from server to client. So that client can draw the amount of money on the ent.

[editline]18th November 2017[/editline]

Well I fixed it by using NetworkVar’s Thanks @go4040

But now I got 1 more problem.
I made a timer.Create in ENT:Initialize and if I spawn 1 printer it works fine but if I spawn another it restarts the timer. How do I make a timer Local to THAT ent?