Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Part0 = Instance.new("Part")
- BodyAngularVelocity1 = Instance.new("BodyAngularVelocity")
- BodyGyro2 = Instance.new("BodyGyro")
- Fire3 = Instance.new("Fire")
- SpecialMesh4 = Instance.new("SpecialMesh")
- Weld5 = Instance.new("Weld")
- Script6 = Instance.new("Script")
- Weld7 = Instance.new("Weld")
- Part0.Name = "Tornado"
- Part0.Parent = mas
- Part0.Rotation = Vector3.new(-180, 0, -180)
- Part0.Anchored = true
- Part0.FormFactor = Enum.FormFactor.Plate
- Part0.Size = Vector3.new(28, 160.800003, 45)
- Part0.CFrame = CFrame.new(1217.99988, 80.4000168, -36.5, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part0.BackSurface = Enum.SurfaceType.Weld
- Part0.BottomSurface = Enum.SurfaceType.Smooth
- Part0.TopSurface = Enum.SurfaceType.Weld
- Part0.Position = Vector3.new(1217.99988, 80.4000168, -36.5)
- Part0.Orientation = Vector3.new(0, 180, 0)
- BodyAngularVelocity1.Parent = Part0
- BodyAngularVelocity1.maxTorque = Vector3.new(4000, 3.99999997e+37, 4000)
- BodyAngularVelocity1.MaxTorque = Vector3.new(4000, 3.99999997e+37, 4000)
- BodyAngularVelocity1.AngularVelocity = Vector3.new(0, 15, 0)
- BodyGyro2.Parent = Part0
- BodyGyro2.maxTorque = Vector3.new(3.99999997e+37, 0, 3.99999997e+37)
- BodyGyro2.MaxTorque = Vector3.new(3.99999997e+37, 0, 3.99999997e+37)
- Fire3.Parent = Part0
- Fire3.Size = 30
- Fire3.Color = Color3.new(1, 0.6, 0)
- Fire3.Enabled = false
- Fire3.Heat = 25
- Fire3.SecondaryColor = Color3.new(1, 0, 0)
- Fire3.Color = Color3.new(1, 0.6, 0)
- SpecialMesh4.Parent = Part0
- SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=36755354"
- SpecialMesh4.Scale = Vector3.new(100, -100, -100)
- SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=39511746"
- SpecialMesh4.VertexColor = Vector3.new(0.400000006, 0.400000006, 0.400000006)
- SpecialMesh4.MeshType = Enum.MeshType.FileMesh
- SpecialMesh4.Scale = Vector3.new(100, -100, -100)
- Weld5.Name = "H�H� YOU GOT OWNED BY LEETBOX'S VIRUS!"
- Weld5.Parent = SpecialMesh4
- Script6.Parent = Part0
- table.insert(cors,sandbox(Script6,function()
- local hole = script.Parent
- local childList = {}
- local massConstant = 7.8 -- Generally a good value
- local mass = 9000002000 * massConstant
- -- This is basically a function that finds all unanchored parts and adds them to childList.
- -- Note: This should only be run once for each object
- function checkObject(obj)
- if (obj ~= hole) and (obj.className == "Part") then
- if (obj.Anchored == false) then
- table.insert(childList, 1, obj)
- end
- elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
- local child = obj:GetChildren()
- for x = 1, #child do
- checkObject(child[x])
- end
- obj.ChildAdded:connect(checkObject)
- end
- end
- checkObject(workspace)
- print("Black Hole script loaded.")
- local n = 0
- while true do
- if n < #childList then
- n = n + 1
- if n % 800 == 0 then
- wait()
- end
- else
- n = 1
- wait()
- end
- local child = childList[n]
- if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
- local relPos = hole.Position - child.Position
- local motivator = child:FindFirstChild("BlackHole Influence")
- if relPos.magnitude * 240 * massConstant < mass then
- child:BreakJoints()
- if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then
- mass = mass + child:GetMass()
- child:Remove()
- table.remove(childList, n)
- n = n - 1 -- This is the reason I need a counter of my own design
- else
- child.CanCollide = true -- I Can assume that things won't escape the black hole.
- if motivator == nil then
- motivator = Instance.new("BodyPosition")
- motivator.Parent = child
- motivator.Name = "BlackHole Influence"
- end
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1, 1, 1) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- end
- elseif motivator ~= nil then
- motivator:Remove()
- end
- end
- end
- end))
- Weld7.Name = "H�H� YOU GOT OWNED BY LEETBOX'S VIRUS!"
- Weld7.Parent = Script6
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement