Since everyone is complaining about SetNW* causing crashes and I happened to need to make a new lib for my server I’ve made nw-vars.
nw-vars are a simple replacement to SetNW*. Data is synced when the player first joins the server and the moment a var is changed. You can optionally set the write, read functions and a filter function to increase efficiency as seen below.
To use place in: lua/includes/modules
Get a var
Set a var
Register the var, this is totally optional, filter and read/write functions are optional
Read = net.ReadString,
Write = net.WriteString,
Filter = function(ent, var, value)
Use this hook instead of InitialSpawn
hook.Add(‘PlayerEntityCreated’, ‘example’, function(pl)