Advertisement
shaieve

Untitled

Apr 11th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. local function RecursiveSetPreventTransmit(ent, ply, stopTransmitting)
  2. if ent ~= ply and IsValid(ent) and IsValid(ply) then
  3. ent:SetPreventTransmit(ply, stopTransmitting)
  4. local tab = ent:GetChildren()
  5. for i = 1, #tab do
  6. RecursiveSetPreventTransmit(tab[ i ], ply, stopTransmitting)
  7. end
  8. end
  9. end
  10.  
  11. function StopNetworkingEntity(ply, bool, admin, target)
  12.  
  13. if target and IsValid(target) then
  14. if ( admin and target:IsAdmin() ) and bool == true then return end
  15.  
  16. RecursiveSetPreventTransmit(ply, target, bool)
  17. return
  18. end
  19.  
  20. for k, v in pairs(player.GetAll()) do
  21. if ( admin and v:IsAdmin() ) and bool == true then continue end
  22.  
  23. RecursiveSetPreventTransmit(ply, v, bool)
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement