What alternatives are there to networked variables?

And which is the best?

Global variables, networked variables work better.

“No help is better then incorrect help”

Ontopic: If you don’t need it to be sent to the client then I would just assign a variable to a table where the first key is the ent’s IDX and the second one is the variable id.

[lua]

local entValues = {};

function _R.Entity:SetVal(_key,_val,_client)
local selfCr = entValues[self:GetCreationID()];
if(!selfCr)then
selfCr = {};
end
selfCr._key = _val;
end

function _R.Entity:GetVal(_key)
local selfCr = entValues[self:GetCreationID()];
if(!selfCr)then
return nil;
end
return selfCr._key or nil;
end
[/lua]

Tell me if you need the client to know them.

PData, but uh it depends on what you’re doing it can also be glon.

He is talking about a variable saving to an entity, not saving after respawn/connect.

I think he just wants variables that are saved on the server.

Ah, okay. So then is saving really neccasarry at all?

PData is not networked.

I would say DTVars are a good way to go BUT they can only be used on SENTs.