So i have been doing css gamemode and i tried doing NetworkVars for multiple things and whenever i try to get the value it always returns nil
https://i.imgur.com/Vp2x0XX.png
Well great, without any code we have no clue
sorry, was about to post
https://i.imgur.com/Fu1fRuk.png
You should be using 'self.Player'.
When i do self.Player it doesn't work
https://i.imgur.com/ZO1Qwpl.png
https://i.imgur.com/TwowHPO.png
Are you setting the player class?
I dont know what that means, im pretty new
You need to run this https://wiki.garrysmod.com/page/player_manager/SetPlayerClass in PlayerSpawn
take a closer look at the second argument of Entity/NetworkVar
I may need help i dont know what arguments to feed it or anything about player_manager
from the gmod wiki
Each network var has to have a unique slot. The slot is per type - so you can have an int in slot 0, a bool in slot 0 and a float in slot 0 etc. but you can't have two ints in slot 0 instead you would do a int in slot 0 and another int in slot 1.
so, you would have to do
self:NetworkVar("Int", 0, "ArmorHead")
self:NetworkVar("Int", 1, "ArmorBody")
self:NetworkVar("Int", 2, "Money")
self:NetworkVar("String", 0, "Knife")
also, if you are trying to use a player class, create a folder in (your gamemode folder)/gamemode/player_class (if you want the player class to be default, use player_default.lua) (If you already have a template, you can copy the template into this LUA file) and then use the changes I made above to PLAYER:SetupDataTables
then, in a hook (preferrably PlayerInitialSpawn or something along those lines), use:
player_manager.SetPlayerClass(PlayerVariable, "player_default") -- change PlayerVariable to whatever you use
Sorry, you need to Log In to post a reply to this thread.