What exactly does this do?

In the darkrp money printer script I was reading through it and saw this

shared:


function ENT:SetupDataTables()
	self:NetworkVar("Entity", 0, "owning_ent")
end

cl_init:


local owner = self:Getowning_ent()
owner = (IsValid(owner) and owner:Nick()) or DarkRP.getPhrase("unknown")

What does it do to extract the owner of the printer? I am not sure how the F$@% it works. clarification would be cool.


function ENT:SetupDataTables()
	self:NetworkVar("Entity", 0, "owning_ent")
end

The function here create a Entity:Set/Getowning_ent functions for the ENT table, assigns ID of 0 and type of Entity to it.

There functions are synched with client whenever Setowning_ent is called on the server, so you can call self:Getowning_ent() in cl_init and it will return the same value as on server.

See this article: http://wiki.garrysmod.com/page/Networking_Entities