Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- 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")
- SpecialMesh1 = Instance.new("SpecialMesh")
- Script2 = Instance.new("Script")
- Part0.Name = "Black Hole"
- Part0.Parent = mas
- Part0.Material = Enum.Material.Slate
- Part0.BrickColor = BrickColor.new("Really black")
- Part0.Rotation = Vector3.new(0, 0, -90)
- Part0.Anchored = true
- Part0.CanCollide = false
- Part0.FormFactor = Enum.FormFactor.Symmetric
- Part0.Shape = Enum.PartType.Ball
- Part0.Size = Vector3.new(8, 8, 8)
- Part0.CFrame = CFrame.new(26.5999985, 43.9998131, -12.5999985, 0, 1, 0, -1, 0, 0, 0, 0, 1)
- Part0.BottomSurface = Enum.SurfaceType.Smooth
- Part0.TopSurface = Enum.SurfaceType.Smooth
- Part0.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part0.Position = Vector3.new(26.5999985, 43.9998131, -12.5999985)
- Part0.Orientation = Vector3.new(0, 0, -90)
- Part0.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- SpecialMesh1.Parent = Part0
- SpecialMesh1.MeshType = Enum.MeshType.Sphere
- Script2.Parent = Part0
- table.insert(cors,sandbox(Script2,function()
- EffectRadius = 50
- maximumAffectedMass = 300
- dragForce = 30
- willKillPlayers = false
- hole = script.Parent
- local veloRef = Instance.new("BodyPosition")
- veloRef.maxForce = Vector3.new(math.huge,math.huge,math.huge)
- veloRef.Name = "Black Hole Influence"
- function getHumanoid(model)
- for i,v in pairs(model:getChildren()) do
- if v.className == "Humanoid" then
- return v
- end
- end
- return nil
- end
- parts = {}
- function getBricks(bin)
- for i,child in pairs(bin:getChildren()) do
- if child.className == "Part" or child.className == "TrussPart" or child.className == "Seat" then
- if (child.Position - hole.Position).magnitude <= EffectRadius and child:findFirstChild(veloRef.Name) == nil and child:getMass() <= maximumAffectedMass and child ~= hole then
- if getHumanoid(child.Parent) ~= nil and not willKillPlayers then
- if child.Name == "Torso" then
- table.insert(parts, child)
- end
- else
- table.insert(parts, child)
- end
- end
- elseif child.className == "Model" then
- print("Model")
- getBricks(child)
- end
- end
- end
- function onTouch(hit)
- if hit.Anchored == false then
- hit:remove()
- end
- end
- hole.Touched:connect(onTouch)
- while true do
- wait(0.5)
- parts = {}
- getBricks(workspace)
- for i,brick in pairs(parts) do
- if brick.Name ~= "Torso" then
- brick:breakJoints()
- brick.CanCollide = false
- end
- local velo = veloRef:clone()
- velo.P = dragForce * 100
- velo.position = hole.Position
- velo.Parent = brick
- end
- end
- end))
- 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