So I’m confused as to how I should proceed with giving players certain attributes and how I should network them. So far I’ve looked up
to avoid using NW* for it’s inefficiency, and I’ve also seen not to use the net library for something that needs to be networked between the client and server.
Mainly because you only want to send a message using the net library and not keep both updated on things. So my main goal here is that I wanted to give
the player certain attributes like below:
ply.mana ply.strength ply.agility --ect.
And of course there will be quite a few, probably 7-10. Now this rules out the usage NW* functions, and keep in mind what I was told about the net library. So I looked into using the following:
local p = FindMetaTable("Player"); function p:SetupDataTables() self:NetworkVar("Int", 0, "Mana") --ect. for each attribute end
I read up some more and apparently you can only occupy four slots for each data type? So that means I could only use the “Int” type for 0-3?(or 0-4 correct me if I’m wrong).
Is this really the only way to properly and efficiently network these attributes for players? If so then I won’t be able to setup all of the attributes I want without creating another entity to stick to the player
which I REALLY wanna avoid doing so since I’m not sure how I would control things from there. Am I reading things wrong and I can go further with this like I plan on?
As a last question for this, if I do happen to use the NetworkVar to setup variables for the player to get/set, if I do the following:
--within the shared.lua file p:SetupDataTables()
Would this mean that technically the client could use the set functions that NetworkVar created? That would be absurd if so, since that would give client control over basically everything right?
If I’m reading this wrong or misunderstanding this I would really appreciate some clarification on this.