#Library for pro devs
1 messages · Page 1 of 1 (latest)
why on every spawn?
https://github.com/BullyHunter32/gmod-nwvar-system/blob/5852fcb9c808d7c760a76c9e4cfd9504a31dd3b3/sv_vars.lua#L94
why on every spawn?
https://github.com/BullyHunter32/gmod-nwvar-system/blob/5852fcb9c808d7c760a76c9e4cfd9504a31dd3b3/sv_vars.lua#L94
It syncs the public variables with only the player who just joined
if that makes sense
use GM:PlayerInitialSpawn to sync only on join
oh shit, right, i see what ur saying
didn't think about that, just thought to replace my hook with some default one, should've thought about it a little more. ty
btw read warning on GM:PlayerInitialSpawn wiki page, I think this method is much better than a timer
I mean, man
You might have left at least a single comment in your code
Not even a README
Uploaded it during a discussion as to why SetNWTable is a stupid idea, pasted it from my gamemode.
Shall add documentation soonish 🙏
Ok
Also
local function Type2String(type)
if type == TYPE_STRING then
return "String"
elseif type == TYPE_NUMBER then
return "Int"
elseif type == TYPE_ENTITY then
return "Entity"
elseif type == TYPE_BOOL then
return "Bool"
elseif type == TYPE_FLOAT then
return "Float"
end
return ""
end
local function ReadType(type)
if type == TYPE_STRING then
return net.ReadString()
elseif type == TYPE_NUMBER then
return net.ReadInt(32)
elseif type == TYPE_ENTITY then
return net.ReadEntity()
elseif type == TYPE_BOOL then
return net.ReadBool()
elseif type == TYPE_FLOAT then
return net.ReadFloat()
end
return
end```This cancer
i love case-switches i love case-switches
Why the fuck do you make same functions in cl and sv instead of making it sh?
wtf
@drifting cypress dud, pls make assoc table
I'm forking this shit
Hell naw
Not global worthy
Would rather copy paste the function than add needless globals tbh
use include then
-- shit.lua
return yourData
-- test.lua
local myData = include("shit.lua")