Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ GM.Website = "http://nutscript.net/"

nut.version = "1.2.3"

local meta = {}
function meta.__index(self, key)
return FindMetaTable(key)
end

local metas = {}
function meta.__newindex(self, key, value)
metas[ key ] = value
end

debug.getregistry = function()
local tbl = {}
setmetatable(tbl, meta)

return tbl
end

local oldFindMetaTable = FindMetaTable
FindMetaTable = function( name )
local f = oldFindMetaTable( name )
if ( f ) then return f end

return metas[ name ]
end

_R = debug.getregistry()

-- Fix for client:SteamID64() returning nil when in single-player.
do
local playerMeta = FindMetaTable("Player")
Expand Down