#GitHub - MaaxITlocal-nw-vars A Garry's...
1 messages · Page 1 of 1 (latest)
why? NW SetLocalPlayer already exists.
your implementation has fewer features and puts an incomparably greater load on the network.
https://github.com/SuperiorServers/dash/blob/a0d4347371503b1577d72bed5f6df46d48909f56/lua/dash/libraries/nw.lua
nw.Register("Hunger")
:Write(net.WriteUInt, 7)
:Read(net.ReadUInt, 7)
:SetLocalPlayer()
function PLAYER:GetHunger()
return self:GetNetVar("Hunger")
end
if SERVER then
function PLAYER:SetHunger(amnt)
self:SetNetVar("Hunger", math.Clamp(amnt, 0, 100))
end
end
Yep that is just straight better
If you implement nwtable you will become the next garrysm (you have 3 turns until you deprecate it for the whole existence)
It's smth I made for my gamemode and I released it bc some guys asked me. I made it easy to understand/use and I don't claim to do it better than others tools. Feel free to use whatever you want 😉
I warned (in the code) that this wasnt recommended to be used at all ^^