Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function RecursiveSetPreventTransmit(ent, ply, stopTransmitting)
- if ent ~= ply and IsValid(ent) and IsValid(ply) then
- ent:SetPreventTransmit(ply, stopTransmitting)
- local tab = ent:GetChildren()
- for i = 1, #tab do
- RecursiveSetPreventTransmit(tab[ i ], ply, stopTransmitting)
- end
- end
- end
- function StopNetworkingEntity(ply, bool, admin, target)
- if target and IsValid(target) then
- if ( admin and target:IsAdmin() ) and bool == true then return end
- RecursiveSetPreventTransmit(ply, target, bool)
- return
- end
- for k, v in pairs(player.GetAll()) do
- if ( admin and v:IsAdmin() ) and bool == true then continue end
- RecursiveSetPreventTransmit(ply, v, bool)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement