Advertisement
Vaeb

Vaeb's Server Cleaner

Jun 17th, 2015
652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.01 KB | None | 0 0
  1. local Plrs = game:GetService("Players")
  2. local Light = game:GetService("Lighting")
  3.  
  4. function Clear(Obj)
  5.     if #Obj:GetChildren() >= 1 and Obj.ClassName ~= "PlayerGui" then
  6.         for _,v in pairs(Obj:GetChildren()) do
  7.             ypcall(function()
  8.                 Clear(v)
  9.             end)
  10.         end
  11.     end
  12.     if Obj.ClassName == "Script" or Obj.ClassName == "LocalScript" then
  13.         Obj.Disabled = true
  14.         Obj:Destroy()
  15.     elseif Obj.ClassName == "Sound" then
  16.         Obj:Stop()
  17.         Obj:Destroy()
  18.     elseif Obj.ClassName ~= "Player" and Obj.ClassName ~= "Backpack" and Obj.ClassName ~= "PlayerGui" and Obj.ClassName ~= "StarterGear" and Obj.ClassName ~= "HealthGUI" then
  19.         Obj:Destroy()
  20.     end
  21. end
  22.  
  23. function Clean()
  24.     Light.GlobalShadows = true
  25.     Light.TimeOfDay = "14:00:00"
  26.     Light.Brightness = 0
  27.     Light.ShadowColor = Color3.new(0.705882, 0.705882, 0.72549)
  28.     Light.Ambient = Color3.new(1, 1, 1)
  29.     Light.ColorShift_Top = Color3.new(0, 0, 0)
  30.     Light.ColorShift_Bottom = Color3.new(0, 0, 0)
  31.     Light.OutdoorAmbient = Color3.new(0.501961, 0.501961, 0.501961)
  32.     Light.FogStart = 0
  33.     Light.FogEnd = 100000
  34.     Light.FogColor = Color3.new(0.752941, 0.752941, 0.752941)
  35.  
  36.     for _,v in pairs(Light:GetChildren()) do
  37.         v:Destroy()
  38.     end
  39.  
  40.     for _,v in pairs(workspace:GetChildren()) do
  41.         if v.ClassName == "Terrain" then
  42.             v:Clear()
  43.         elseif v.ClassName == "Script" or v.ClassName == "LocalScript" then
  44.             v.Disabled = true
  45.             v:Destroy()
  46.         elseif v.ClassName == "Sound" then
  47.             v:Stop()
  48.             v:Destroy()
  49.         else
  50.             v:Destroy()
  51.         end
  52.     end
  53.     local Base = Instance.new("Part")
  54.     Base.BrickColor = BrickColor.new("Bright green")
  55.     Base.Position = Vector3.new(0, -0.600000024, 0)
  56.     Base.CanCollide = true
  57.     Base.Size = Vector3.new(700, 1.20000005, 700)
  58.     Base.Material = "Grass"
  59.     Base.Locked = true
  60.     Base.Anchored = true
  61.     Base.Name = "Base"
  62.     Base.TopSurface = "Smooth"
  63.     Base.BottomSurface = "Smooth"
  64.     Base.Parent = workspace
  65.     for _,v in pairs(Plrs:GetPlayers()) do
  66.         pcall(function()
  67.             v:LoadCharacter()
  68.         end)
  69.     end
  70. end
  71.  
  72. for _,v in pairs(game:GetChildren()) do
  73.     ypcall(function()
  74.         if v.Name ~= "workspace" and v.Name ~= "Players" and v.Name ~= "NetworkServer" and v.Name ~= "StarterPlayer" then --and v.Name ~= "ReplicatedStorage"
  75.             for _,v2 in pairs(v:GetChildren()) do
  76.                 if v2.Name ~= "SBEvent" then
  77.                     pcall(function()
  78.                         if v2.ClassName == "Script" or v2.ClassName == "LocalScript" then
  79.                             v2.Disabled = true
  80.                             v2:Destroy()
  81.                         elseif v2.ClassName == "Sound" then
  82.                             v2:Stop()
  83.                             v2:Destroy()
  84.                         else
  85.                             v2:Destroy()
  86.                         end
  87.                     end)
  88.                 end
  89.             end
  90.         elseif v.Name == "Players" then
  91.             for _,v2 in pairs(v:GetChildren()) do
  92.                 if v2.ClassName == "Player" then
  93.                     ypcall(function()
  94.                         Clear(v2)
  95.                     end)
  96.                 else
  97.                     pcall(function()
  98.                         if v2.ClassName == "Script" or v2.ClassName == "LocalScript" then
  99.                             v2.Disabled = true
  100.                             v2:Destroy()
  101.                         elseif v2.ClassName == "Sound" then
  102.                             v2:Stop()
  103.                             v2:Destroy()
  104.                         else
  105.                             v2:Destroy()
  106.                         end
  107.                     end)
  108.                 end
  109.             end
  110.         end
  111.     end)
  112. end
  113.  
  114. Clean()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement