Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local _G = GLOBAL
- if _G.rawget(_G,"EQUIPSLOT_IDS") ~= nil then
- local new = {"back", "neck"}
- local slots = #_G.EQUIPSLOT_IDS
- for i, v in ipairs(new) do
- if _G.EQUIPSLOT_IDS[v] == nil then
- slots = slots + 1
- _G.EQUIPSLOT_IDS[v] = slots
- end
- end
- local FindUpvalue = function(fn, upvalue_name, member_check, no_print)
- local info = _G.debug.getinfo(fn, "u")
- local nups = info and info.nups
- if not nups then return end
- local getupvalue = _G.debug.getupvalue
- local s = ''
- for i = 1, nups do
- local name, val = getupvalue(fn, i)
- s = s .. "\t" .. name .. ": " .. type(val) .. "\n"
- if (name == upvalue_name)
- and ((not member_check) or (type(val)=="table" and val[member_check] ~= nil))
- then
- return val, true
- end
- end
- if no_print == nil then
- print("CRITICAL ERROR: Can't find variable "..tostring(upvalue_name).."!")
- print(s)
- end
- end
- local replica = GLOBAL.require "components/equippable_replica"
- local EQUIPSLOT_NAMES = FindUpvalue(replica.EquipSlot, "EQUIPSLOT_NAMES", 1)
- local EQUIPSLOT_IDS = FindUpvalue(replica.SetEquipSlot, "EQUIPSLOT_IDS", "head")
- if EQUIPSLOT_NAMES == nil or EQUIPSLOT_IDS == nil then
- print("EXTRA EQUIP SLOTS ERROR")
- return
- else
- for j,v in ipairs(_G.EQUIPSLOT_IDS) do
- EQUIPSLOT_NAMES[j] = v
- EQUIPSLOT_IDS[v] = j
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement