Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local meta = FindMetaTable("Player")
- local old_SetNWBool = meta.SetNWBool
- function meta:SetNWBool(str, bool)
- if str == "SpecDM_Enabled" then
- ghosttable[self] = bool == true and true or nil
- end
- old_SetNWBool(self, str, bool)
- end
- local oldTraceLine = util.TraceLine
- function util.TraceLine(tbl)
- local is_ghost = LocalPlayer():IsGhost()
- if (is_ghost and showalive:GetBool()) then
- return oldTraceLine(tbl)
- end
- local ignoretbl = {}
- for k, v in pairs(ghosttable) do
- if !IsValid(v) then ghosttable[k] = nil continue end
- table.insert(ignoretbl, v)
- end
- local filt = tbl.filter
- if filt then
- if isentity(filt) then
- tbl.filter = {}
- table.insert(tbl.filter, filt)
- table.Add(tbl.filter, ignoretbl)
- elseif istable(filt) then
- table.Add(tbl.filter, ignoretbl)
- elseif isfunction(filt) then
- tbl.filter = function(ent)
- if ignoretbl[ent] then
- return false
- end
- return filt()
- end
- end
- else
- tbl.filter = ignoretbl
- end
- return oldTraceLine(tbl)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement