daily pastebin goal
56%
SHARE
TWEET

Tornado

LondySecretService Aug 12th, 2017 (edited) 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function sandbox(var,func)
  3.     local env = getfenv(func)
  4.     local newenv = setmetatable({},{
  5.         __index = function(self,k)
  6.             if k=="script" then
  7.                 return var
  8.             else
  9.                 return env[k]
  10.             end
  11.         end,
  12.     })
  13.     setfenv(func,newenv)
  14.     return func
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. Part0 = Instance.new("Part")
  19. BodyAngularVelocity1 = Instance.new("BodyAngularVelocity")
  20. BodyGyro2 = Instance.new("BodyGyro")
  21. Fire3 = Instance.new("Fire")
  22. SpecialMesh4 = Instance.new("SpecialMesh")
  23. Weld5 = Instance.new("Weld")
  24. Script6 = Instance.new("Script")
  25. Weld7 = Instance.new("Weld")
  26. Part0.Name = "Tornado"
  27. Part0.Parent = mas
  28. Part0.Rotation = Vector3.new(-180, 0, -180)
  29. Part0.Anchored = true
  30. Part0.FormFactor = Enum.FormFactor.Plate
  31. Part0.Size = Vector3.new(28, 160.800003, 45)
  32. Part0.CFrame = CFrame.new(1217.99988, 80.4000168, -36.5, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  33. Part0.BackSurface = Enum.SurfaceType.Weld
  34. Part0.BottomSurface = Enum.SurfaceType.Smooth
  35. Part0.TopSurface = Enum.SurfaceType.Weld
  36. Part0.Position = Vector3.new(1217.99988, 80.4000168, -36.5)
  37. Part0.Orientation = Vector3.new(0, 180, 0)
  38. BodyAngularVelocity1.Parent = Part0
  39. BodyAngularVelocity1.maxTorque = Vector3.new(4000, 3.99999997e+37, 4000)
  40. BodyAngularVelocity1.MaxTorque = Vector3.new(4000, 3.99999997e+37, 4000)
  41. BodyAngularVelocity1.AngularVelocity = Vector3.new(0, 15, 0)
  42. BodyGyro2.Parent = Part0
  43. BodyGyro2.maxTorque = Vector3.new(3.99999997e+37, 0, 3.99999997e+37)
  44. BodyGyro2.MaxTorque = Vector3.new(3.99999997e+37, 0, 3.99999997e+37)
  45. Fire3.Parent = Part0
  46. Fire3.Size = 30
  47. Fire3.Color = Color3.new(1, 0.6, 0)
  48. Fire3.Enabled = false
  49. Fire3.Heat = 25
  50. Fire3.SecondaryColor = Color3.new(1, 0, 0)
  51. Fire3.Color = Color3.new(1, 0.6, 0)
  52. SpecialMesh4.Parent = Part0
  53. SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=36755354"
  54. SpecialMesh4.Scale = Vector3.new(100, -100, -100)
  55. SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=39511746"
  56. SpecialMesh4.VertexColor = Vector3.new(0.400000006, 0.400000006, 0.400000006)
  57. SpecialMesh4.MeshType = Enum.MeshType.FileMesh
  58. SpecialMesh4.Scale = Vector3.new(100, -100, -100)
  59. Weld5.Name = "H�H� YOU GOT OWNED BY LEETBOX'S VIRUS!"
  60. Weld5.Parent = SpecialMesh4
  61. Script6.Parent = Part0
  62. table.insert(cors,sandbox(Script6,function()
  63. local hole = script.Parent
  64. local childList = {}
  65.  
  66. local massConstant = 7.8 -- Generally a good value
  67.  
  68. local mass = 9000002000 * massConstant
  69.  
  70. -- This is basically a function that finds all unanchored parts and adds them to childList.
  71. -- Note: This should only be run once for each object
  72. function checkObject(obj)
  73.     if (obj ~= hole) and (obj.className == "Part") then
  74.         if (obj.Anchored == false) then
  75.             table.insert(childList, 1, obj)
  76.         end
  77.     elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  78.         local child = obj:GetChildren()
  79.         for x = 1, #child do
  80.             checkObject(child[x])
  81.         end
  82.         obj.ChildAdded:connect(checkObject)
  83.     end
  84. end
  85.  
  86. checkObject(workspace)
  87.  
  88. print("Black Hole script loaded.")
  89.  
  90. local n = 0
  91. while true do
  92.     if n < #childList then
  93.         n = n + 1
  94.         if n % 800 == 0 then
  95.             wait()
  96.         end
  97.     else
  98.         n = 1
  99.         wait()
  100.     end
  101.  
  102.     local child = childList[n]
  103.     if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
  104.         local relPos = hole.Position - child.Position
  105.         local motivator = child:FindFirstChild("BlackHole Influence")
  106.         if relPos.magnitude * 240 * massConstant < mass then
  107.             child:BreakJoints()
  108.             if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x >  relPos.magnitude * 2 - 4) then
  109.                 mass = mass + child:GetMass()
  110.                 child:Remove()
  111.                 table.remove(childList, n)
  112.                 n = n - 1 -- This is the reason I need a counter of my own design
  113.             else
  114.                 child.CanCollide = true -- I Can assume that things won't escape the black hole.
  115.                 if motivator == nil then
  116.                     motivator = Instance.new("BodyPosition")
  117.                     motivator.Parent = child
  118.                     motivator.Name = "BlackHole Influence"
  119.                 end
  120.                 motivator.position = hole.Position
  121.                 motivator.maxForce = Vector3.new(1, 1, 1) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  122.             end
  123.         elseif motivator ~= nil then
  124.             motivator:Remove()
  125.         end
  126.     end
  127. end
  128. end))
  129. Weld7.Name = "H�H� YOU GOT OWNED BY LEETBOX'S VIRUS!"
  130. Weld7.Parent = Script6
  131. for i,v in pairs(mas:GetChildren()) do
  132.     v.Parent = workspace
  133.     pcall(function() v:MakeJoints() end)
  134. end
  135. mas:Destroy()
  136. for i,v in pairs(cors) do
  137.     spawn(function()
  138.         pcall(v)
  139.     end)
  140. end
RAW Paste Data
Top