Advertisement
Guest User

Untitled

a guest
May 27th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. local meta = FindMetaTable("Player")
  2. local old_SetNWBool = meta.SetNWBool
  3. function meta:SetNWBool(str, bool)
  4. if str == "SpecDM_Enabled" then
  5. ghosttable[self] = bool == true and true or nil
  6. end
  7. old_SetNWBool(self, str, bool)
  8. end
  9.  
  10. local oldTraceLine = util.TraceLine
  11. function util.TraceLine(tbl)
  12. local is_ghost = LocalPlayer():IsGhost()
  13. if (is_ghost and showalive:GetBool()) then
  14. return oldTraceLine(tbl)
  15. end
  16. local ignoretbl = {}
  17. for k, v in pairs(ghosttable) do
  18. if !IsValid(v) then ghosttable[k] = nil continue end
  19. table.insert(ignoretbl, v)
  20. end
  21. local filt = tbl.filter
  22. if filt then
  23. if isentity(filt) then
  24. tbl.filter = {}
  25. table.insert(tbl.filter, filt)
  26. table.Add(tbl.filter, ignoretbl)
  27. elseif istable(filt) then
  28. table.Add(tbl.filter, ignoretbl)
  29. elseif isfunction(filt) then
  30. tbl.filter = function(ent)
  31. if ignoretbl[ent] then
  32. return false
  33. end
  34. return filt()
  35. end
  36. end
  37. else
  38. tbl.filter = ignoretbl
  39. end
  40. return oldTraceLine(tbl)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement