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"))
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- Script2 = Instance.new("Script")
- ParticleEmitter3 = Instance.new("ParticleEmitter")
- ParticleEmitter4 = Instance.new("ParticleEmitter")
- Script5 = Instance.new("Script")
- Script6 = Instance.new("Script")
- Vector3Value7 = Instance.new("Vector3Value")
- Part8 = Instance.new("Part")
- Script9 = Instance.new("Script")
- ParticleEmitter10 = Instance.new("ParticleEmitter")
- ParticleEmitter11 = Instance.new("ParticleEmitter")
- ParticleEmitter12 = Instance.new("ParticleEmitter")
- ParticleEmitter13 = Instance.new("ParticleEmitter")
- Script14 = Instance.new("Script")
- Script15 = Instance.new("Script")
- Vector3Value16 = Instance.new("Vector3Value")
- Part17 = Instance.new("Part")
- Script18 = Instance.new("Script")
- ParticleEmitter19 = Instance.new("ParticleEmitter")
- ParticleEmitter20 = Instance.new("ParticleEmitter")
- ParticleEmitter21 = Instance.new("ParticleEmitter")
- ParticleEmitter22 = Instance.new("ParticleEmitter")
- Script23 = Instance.new("Script")
- Script24 = Instance.new("Script")
- Vector3Value25 = Instance.new("Vector3Value")
- Part26 = Instance.new("Part")
- ParticleEmitter27 = Instance.new("ParticleEmitter")
- Script28 = Instance.new("Script")
- Script29 = Instance.new("Script")
- Vector3Value30 = Instance.new("Vector3Value")
- Part31 = Instance.new("Part")
- ParticleEmitter32 = Instance.new("ParticleEmitter")
- Script33 = Instance.new("Script")
- Script34 = Instance.new("Script")
- Vector3Value35 = Instance.new("Vector3Value")
- Script36 = Instance.new("Script")
- Model0.Name = "Black Hole"
- Model0.Parent = mas
- Model0.PrimaryPart = Part17
- Part1.Name = "Quasars"
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(16.1907215, 0.847259998, 21.1910152, 0.535558999, -0.258820951, 0.80385828, 0.143505514, 0.965922713, 0.215395257, -0.832218707, 1.97826739e-06, 0.554456055)
- Part1.Orientation = Vector3.new(-12.4399996, 55.3999977, 8.44999981)
- Part1.Position = Vector3.new(16.1907215, 0.847259998, 21.1910152)
- Part1.Rotation = Vector3.new(-21.2299995, 53.5, 25.789999)
- Part1.Color = Color3.new(0, 1, 1)
- Part1.Transparency = 1
- Part1.Size = Vector3.new(2, 1, 2)
- Part1.Anchored = true
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Toothpaste")
- Part1.CanCollide = false
- Part1.Material = Enum.Material.Neon
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Toothpaste")
- Script2.Parent = Part1
- table.insert(cors,sandbox(Script2,function()
- while wait(0.0001) do
- script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
- end
- end))
- ParticleEmitter3.Parent = Part1
- ParticleEmitter3.Speed = NumberRange.new(50, 50)
- ParticleEmitter3.Color = ColorSequence.new(Color3.new(0.333333, 0, 1),Color3.new(0.333333, 0, 1))
- ParticleEmitter3.LightEmission = 1
- ParticleEmitter3.Texture = "rbxassetid://81137714"
- ParticleEmitter3.Transparency = NumberSequence.new(0.5,0.5)
- ParticleEmitter3.Size = NumberSequence.new(0.87499976158142,2.3125,0.43749988079071)
- ParticleEmitter3.Lifetime = NumberRange.new(1, 1)
- ParticleEmitter3.Rate = 1000
- ParticleEmitter3.SpreadAngle = Vector2.new(2, 2)
- ParticleEmitter3.VelocitySpread = 2
- ParticleEmitter4.Parent = Part1
- ParticleEmitter4.Speed = NumberRange.new(50, 50)
- ParticleEmitter4.Color = ColorSequence.new(Color3.new(0.333333, 0, 1),Color3.new(0.333333, 0, 1))
- ParticleEmitter4.LightEmission = 1
- ParticleEmitter4.Texture = "rbxassetid://81137714"
- ParticleEmitter4.Transparency = NumberSequence.new(0.5,0.5)
- ParticleEmitter4.Size = NumberSequence.new(0.87499976158142,2.3125,0.43749988079071)
- ParticleEmitter4.EmissionDirection = Enum.NormalId.Bottom
- ParticleEmitter4.Lifetime = NumberRange.new(1, 1)
- ParticleEmitter4.Rate = 1000
- ParticleEmitter4.SpreadAngle = Vector2.new(2, 2)
- ParticleEmitter4.VelocitySpread = 2
- Script5.Name = "attract"
- Script5.Parent = Part1
- table.insert(cors,sandbox(Script5,function()
- local hole = script.Parent
- local childList = {}
- local massConstant = 888888 -- Generally a good value
- local mass = 40000 * 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(0.5)
- end
- else
- n = 1
- wait(0.5)
- 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 * 350 * massConstant < mass then
- local a = math.random(1,4)
- if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
- child:BreakJoints()
- end
- 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 = false -- I Can assume that things won't escape the black hole.
- if motivator == nil then
- motivator = Instance.new("BodyPosition")
- motivator.Parent = child
- --game:GetService("Debris"):AddItem(motivator,0.4)
- motivator.Name = "BlackHole Influence"
- end
- if child.Parent:findFirstChild("Humanoid") ~= nil then
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- motivator:remove()
- local posfind = child.Parent:findFirstChild("Torso")
- if posfind ~= nil then
- local posfind2 = posfind:findFirstChild("gotopos")
- if posfind2== nil then
- aa= script.gotopos:Clone()
- aa.Disabled=false
- game:GetService("Debris"):AddItem(aa,10)
- aa.Value.Value=script.Parent.Position
- aa.Parent=child.Parent.Torso
- end
- end
- else
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- end
- end
- elseif motivator ~= nil then
- motivator:Remove()
- end
- end
- end
- end))
- Script6.Name = "gotopos"
- Script6.Parent = Script5
- table.insert(cors,sandbox(Script6,function()
- print 'Hello world!'
- local b = script.Value.Value
- while true do
- wait(0.1)
- local a = script.Parent.Position
- local dir = (a - b).unit
- dir=dir*-1
- script.Parent.Velocity = dir*50
- end
- end))
- Script6.Disabled = true
- Vector3Value7.Parent = Script6
- Part8.Name = "Rings"
- Part8.Parent = Model0
- Part8.CFrame = CFrame.new(16.1907215, 0.847259998, 21.1910152, 0.949450195, -0.258820474, 0.177639887, 0.254407436, 0.965922773, 0.047598023, -0.183905482, 1.72745342e-06, 0.98294884)
- Part8.Orientation = Vector3.new(-2.73000002, 10.2399998, 14.7599993)
- Part8.Position = Vector3.new(16.1907215, 0.847259998, 21.1910152)
- Part8.Rotation = Vector3.new(-2.76999998, 10.2299995, 15.25)
- Part8.Color = Color3.new(0, 1, 1)
- Part8.Transparency = 1
- Part8.Size = Vector3.new(2, 1, 2)
- Part8.Anchored = true
- Part8.BottomSurface = Enum.SurfaceType.Smooth
- Part8.BrickColor = BrickColor.new("Toothpaste")
- Part8.CanCollide = false
- Part8.Material = Enum.Material.Neon
- Part8.TopSurface = Enum.SurfaceType.Smooth
- Part8.brickColor = BrickColor.new("Toothpaste")
- Script9.Parent = Part8
- table.insert(cors,sandbox(Script9,function()
- while wait(0.0001) do
- script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
- end
- end))
- ParticleEmitter10.Parent = Part8
- ParticleEmitter10.Color = ColorSequence.new(Color3.new(0.894118, 0.470588, 1),Color3.new(0.301961, 0.14902, 0.458824))
- ParticleEmitter10.LightEmission = 0.80000001192093
- ParticleEmitter10.Texture = "rbxassetid://254959503"
- ParticleEmitter10.EmissionDirection = Enum.NormalId.Right
- ParticleEmitter10.Lifetime = NumberRange.new(3, 3)
- ParticleEmitter10.Rate = 250
- ParticleEmitter11.Parent = Part8
- ParticleEmitter11.Color = ColorSequence.new(Color3.new(0.894118, 0.470588, 1),Color3.new(0.301961, 0.14902, 0.458824))
- ParticleEmitter11.LightEmission = 0.80000001192093
- ParticleEmitter11.Texture = "rbxassetid://254959503"
- ParticleEmitter11.EmissionDirection = Enum.NormalId.Back
- ParticleEmitter11.Lifetime = NumberRange.new(3, 3)
- ParticleEmitter11.Rate = 250
- ParticleEmitter12.Parent = Part8
- ParticleEmitter12.Color = ColorSequence.new(Color3.new(0.894118, 0.470588, 1),Color3.new(0.301961, 0.14902, 0.458824))
- ParticleEmitter12.LightEmission = 0.80000001192093
- ParticleEmitter12.Texture = "rbxassetid://254959503"
- ParticleEmitter12.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter12.Lifetime = NumberRange.new(3, 3)
- ParticleEmitter12.Rate = 250
- ParticleEmitter13.Parent = Part8
- ParticleEmitter13.Color = ColorSequence.new(Color3.new(0.894118, 0.470588, 1),Color3.new(0.301961, 0.14902, 0.458824))
- ParticleEmitter13.LightEmission = 0.80000001192093
- ParticleEmitter13.Texture = "rbxassetid://254959503"
- ParticleEmitter13.EmissionDirection = Enum.NormalId.Left
- ParticleEmitter13.Lifetime = NumberRange.new(3, 3)
- ParticleEmitter13.Rate = 250
- Script14.Name = "attract"
- Script14.Parent = Part8
- table.insert(cors,sandbox(Script14,function()
- local hole = script.Parent
- local childList = {}
- local massConstant = 5.8 -- Generally a good value
- local mass = 40000 * 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(0.5)
- end
- else
- n = 1
- wait(0.5)
- 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 * 350 * massConstant < mass then
- local a = math.random(1,4)
- if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
- child:BreakJoints()
- end
- 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 = false -- I Can assume that things won't escape the black hole.
- if motivator == nil then
- motivator = Instance.new("BodyPosition")
- motivator.Parent = child
- --game:GetService("Debris"):AddItem(motivator,0.4)
- motivator.Name = "BlackHole Influence"
- end
- if child.Parent:findFirstChild("Humanoid") ~= nil then
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- motivator:remove()
- local posfind = child.Parent:findFirstChild("Torso")
- if posfind ~= nil then
- local posfind2 = posfind:findFirstChild("gotopos")
- if posfind2== nil then
- aa= script.gotopos:Clone()
- aa.Disabled=false
- game:GetService("Debris"):AddItem(aa,10)
- aa.Value.Value=script.Parent.Position
- aa.Parent=child.Parent.Torso
- end
- end
- else
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- end
- end
- elseif motivator ~= nil then
- motivator:Remove()
- end
- end
- end
- end))
- Script15.Name = "gotopos"
- Script15.Parent = Script14
- table.insert(cors,sandbox(Script15,function()
- print 'Hello world!'
- local b = script.Value.Value
- while true do
- wait(0.1)
- local a = script.Parent.Position
- local dir = (a - b).unit
- dir=dir*-1
- script.Parent.Velocity = dir*30
- end
- end))
- Script15.Disabled = true
- Vector3Value16.Parent = Script15
- Part17.Name = "Rings"
- Part17.Parent = Model0
- Part17.CFrame = CFrame.new(16.1907215, 0.847259998, 21.1910152, 0.613135338, -0.258820951, 0.746375561, 0.164292201, 0.965922713, 0.199992523, -0.77270776, 1.96877659e-06, 0.63476938)
- Part17.Orientation = Vector3.new(-11.54, 49.6199989, 9.64999962)
- Part17.Position = Vector3.new(16.1907215, 0.847259998, 21.1910152)
- Part17.Rotation = Vector3.new(-17.4899998, 48.2799988, 22.8899994)
- Part17.Color = Color3.new(0, 1, 1)
- Part17.Transparency = 1
- Part17.Size = Vector3.new(2, 1, 2)
- Part17.Anchored = true
- Part17.BottomSurface = Enum.SurfaceType.Smooth
- Part17.BrickColor = BrickColor.new("Toothpaste")
- Part17.CanCollide = false
- Part17.Material = Enum.Material.Neon
- Part17.TopSurface = Enum.SurfaceType.Smooth
- Part17.brickColor = BrickColor.new("Toothpaste")
- Script18.Parent = Part17
- table.insert(cors,sandbox(Script18,function()
- while wait(0.0001) do
- script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
- end
- end))
- ParticleEmitter19.Parent = Part17
- ParticleEmitter19.Color = ColorSequence.new(Color3.new(0.894118, 0.470588, 1),Color3.new(0.301961, 0.14902, 0.458824))
- ParticleEmitter19.LightEmission = 0.80000001192093
- ParticleEmitter19.Texture = "rbxassetid://254959503"
- ParticleEmitter19.EmissionDirection = Enum.NormalId.Right
- ParticleEmitter19.Lifetime = NumberRange.new(3, 3)
- ParticleEmitter19.Rate = 250
- ParticleEmitter20.Parent = Part17
- ParticleEmitter20.Color = ColorSequence.new(Color3.new(0.894118, 0.470588, 1),Color3.new(0.301961, 0.14902, 0.458824))
- ParticleEmitter20.LightEmission = 0.80000001192093
- ParticleEmitter20.Texture = "rbxassetid://254959503"
- ParticleEmitter20.EmissionDirection = Enum.NormalId.Back
- ParticleEmitter20.Lifetime = NumberRange.new(3, 3)
- ParticleEmitter20.Rate = 250
- ParticleEmitter21.Parent = Part17
- ParticleEmitter21.Color = ColorSequence.new(Color3.new(0.894118, 0.470588, 1),Color3.new(0.301961, 0.14902, 0.458824))
- ParticleEmitter21.LightEmission = 0.80000001192093
- ParticleEmitter21.Texture = "rbxassetid://254959503"
- ParticleEmitter21.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter21.Lifetime = NumberRange.new(3, 3)
- ParticleEmitter21.Rate = 250
- ParticleEmitter22.Parent = Part17
- ParticleEmitter22.Color = ColorSequence.new(Color3.new(0.894118, 0.470588, 1),Color3.new(0.301961, 0.14902, 0.458824))
- ParticleEmitter22.LightEmission = 0.80000001192093
- ParticleEmitter22.Texture = "rbxassetid://254959503"
- ParticleEmitter22.EmissionDirection = Enum.NormalId.Left
- ParticleEmitter22.Lifetime = NumberRange.new(3, 3)
- ParticleEmitter22.Rate = 250
- Script23.Name = "attract"
- Script23.Parent = Part17
- table.insert(cors,sandbox(Script23,function()
- local hole = script.Parent
- local childList = {}
- local massConstant = 5.8 -- Generally a good value
- local mass = 40000 * 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(0.5)
- end
- else
- n = 1
- wait(0.5)
- 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 * 350 * massConstant < mass then
- local a = math.random(1,4)
- if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
- child:BreakJoints()
- end
- 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 = false -- I Can assume that things won't escape the black hole.
- if motivator == nil then
- motivator = Instance.new("BodyPosition")
- motivator.Parent = child
- --game:GetService("Debris"):AddItem(motivator,0.4)
- motivator.Name = "BlackHole Influence"
- end
- if child.Parent:findFirstChild("Humanoid") ~= nil then
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- motivator:remove()
- local posfind = child.Parent:findFirstChild("Torso")
- if posfind ~= nil then
- local posfind2 = posfind:findFirstChild("gotopos")
- if posfind2== nil then
- aa= script.gotopos:Clone()
- aa.Disabled=false
- game:GetService("Debris"):AddItem(aa,10)
- aa.Value.Value=script.Parent.Position
- aa.Parent=child.Parent.Torso
- end
- end
- else
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- end
- end
- elseif motivator ~= nil then
- motivator:Remove()
- end
- end
- end
- end))
- Script24.Name = "gotopos"
- Script24.Parent = Script23
- table.insert(cors,sandbox(Script24,function()
- print 'Hello world!'
- local b = script.Value.Value
- while true do
- wait(0.1)
- local a = script.Parent.Position
- local dir = (a - b).unit
- dir=dir*-1
- script.Parent.Velocity = dir*30
- end
- end))
- Script24.Disabled = true
- Vector3Value25.Parent = Script24
- Part26.Name = "Shine"
- Part26.Parent = Model0
- Part26.CFrame = CFrame.new(16.079874, 1.02206242, 21.1910267, 0.965925157, -0.258821905, -5.9178401e-06, 0.258821934, 0.965925097, -3.41922555e-06, 6.60116075e-06, 1.77104937e-06, 1)
- Part26.Orientation = Vector3.new(0, 0, 15)
- Part26.Position = Vector3.new(16.079874, 1.02206242, 21.1910267)
- Part26.Rotation = Vector3.new(0, 0, 15)
- Part26.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part26.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- Part26.Anchored = true
- Part26.BottomSurface = Enum.SurfaceType.Smooth
- Part26.BrickColor = BrickColor.new("Really black")
- Part26.CanCollide = false
- Part26.FrontParamA = 0
- Part26.FrontParamB = 0
- Part26.Material = Enum.Material.SmoothPlastic
- Part26.TopSurface = Enum.SurfaceType.Smooth
- Part26.brickColor = BrickColor.new("Really black")
- Part26.Shape = Enum.PartType.Ball
- ParticleEmitter27.Parent = Part26
- ParticleEmitter27.Speed = NumberRange.new(0, 0)
- ParticleEmitter27.Color = ColorSequence.new(Color3.new(0.615686, 0.32549, 0.690196),Color3.new(0.333333, 0, 0.498039))
- ParticleEmitter27.LightEmission = 0.69999998807907
- ParticleEmitter27.Texture = "rbxassetid://286708119"
- ParticleEmitter27.Size = NumberSequence.new(2.5,2.5)
- ParticleEmitter27.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter27.Lifetime = NumberRange.new(0.10000000149012, 0.10000000149012)
- ParticleEmitter27.Rate = 1000
- Script28.Name = "attract"
- Script28.Parent = Part26
- table.insert(cors,sandbox(Script28,function()
- local hole = script.Parent
- local childList = {}
- local massConstant = 5.8 -- Generally a good value
- local mass = 40000 * 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(0.5)
- end
- else
- n = 1
- wait(0.5)
- 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 * 350 * massConstant < mass then
- local a = math.random(1,4)
- if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
- child:BreakJoints()
- end
- 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 = false -- I Can assume that things won't escape the black hole.
- if motivator == nil then
- motivator = Instance.new("BodyPosition")
- motivator.Parent = child
- --game:GetService("Debris"):AddItem(motivator,0.4)
- motivator.Name = "BlackHole Influence"
- end
- if child.Parent:findFirstChild("Humanoid") ~= nil then
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- motivator:remove()
- local posfind = child.Parent:findFirstChild("Torso")
- if posfind ~= nil then
- local posfind2 = posfind:findFirstChild("gotopos")
- if posfind2== nil then
- aa= script.gotopos:Clone()
- aa.Disabled=false
- game:GetService("Debris"):AddItem(aa,10)
- aa.Value.Value=script.Parent.Position
- aa.Parent=child.Parent.Torso
- end
- end
- else
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- end
- end
- elseif motivator ~= nil then
- motivator:Remove()
- end
- end
- end
- end))
- Script29.Name = "gotopos"
- Script29.Parent = Script28
- table.insert(cors,sandbox(Script29,function()
- print 'Hello world!'
- local b = script.Value.Value
- while true do
- wait(0.1)
- local a = script.Parent.Position
- local dir = (a - b).unit
- dir=dir*-1
- script.Parent.Velocity = dir*30
- end
- end))
- Script29.Disabled = true
- Vector3Value30.Parent = Script29
- Part31.Name = "Singularity"
- Part31.Parent = Model0
- Part31.CFrame = CFrame.new(16.0798931, 0.954685628, 21.1910172, 0.965925157, -0.258821905, -5.9178401e-06, 0.258821934, 0.965925097, -3.41922555e-06, 6.60116075e-06, 1.77104937e-06, 1)
- Part31.Orientation = Vector3.new(0, 0, 15)
- Part31.Position = Vector3.new(16.0798931, 0.954685628, 21.1910172)
- Part31.Rotation = Vector3.new(0, 0, 15)
- Part31.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part31.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- Part31.Anchored = true
- Part31.BottomSurface = Enum.SurfaceType.Smooth
- Part31.BrickColor = BrickColor.new("Really black")
- Part31.CanCollide = false
- Part31.FrontParamA = 0
- Part31.FrontParamB = 0
- Part31.Material = Enum.Material.SmoothPlastic
- Part31.TopSurface = Enum.SurfaceType.Smooth
- Part31.brickColor = BrickColor.new("Really black")
- Part31.Shape = Enum.PartType.Ball
- ParticleEmitter32.Parent = Part31
- ParticleEmitter32.Speed = NumberRange.new(0, 0)
- ParticleEmitter32.Color = ColorSequence.new(Color3.new(0, 0, 0),Color3.new(0, 0, 0))
- ParticleEmitter32.Texture = "rbxassetid://286708119"
- ParticleEmitter32.ZOffset = 1
- ParticleEmitter32.Size = NumberSequence.new(2.2000000476837,2.2000000476837)
- ParticleEmitter32.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter32.Lifetime = NumberRange.new(0.10000000149012, 0.10000000149012)
- ParticleEmitter32.Rate = 1000
- Script33.Name = "attract"
- Script33.Parent = Part31
- table.insert(cors,sandbox(Script33,function()
- local hole = script.Parent
- local childList = {}
- local massConstant = 5.8 -- Generally a good value
- local mass = 40000 * 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(0.5)
- end
- else
- n = 1
- wait(0.5)
- 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 * 350 * massConstant < mass then
- local a = math.random(1,4)
- if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
- child:BreakJoints()
- end
- 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 = false -- I Can assume that things won't escape the black hole.
- if motivator == nil then
- motivator = Instance.new("BodyPosition")
- motivator.Parent = child
- --game:GetService("Debris"):AddItem(motivator,0.4)
- motivator.Name = "BlackHole Influence"
- end
- if child.Parent:findFirstChild("Humanoid") ~= nil then
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- motivator:remove()
- local posfind = child.Parent:findFirstChild("Torso")
- if posfind ~= nil then
- local posfind2 = posfind:findFirstChild("gotopos")
- if posfind2== nil then
- aa= script.gotopos:Clone()
- aa.Disabled=false
- game:GetService("Debris"):AddItem(aa,10)
- aa.Value.Value=script.Parent.Position
- aa.Parent=child.Parent.Torso
- end
- end
- else
- motivator.position = hole.Position
- motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
- end
- end
- elseif motivator ~= nil then
- motivator:Remove()
- end
- end
- end
- end))
- Script34.Name = "gotopos"
- Script34.Parent = Script33
- table.insert(cors,sandbox(Script34,function()
- print 'Hello world!'
- local b = script.Value.Value
- while true do
- wait(0.1)
- local a = script.Parent.Position
- local dir = (a - b).unit
- dir=dir*-1
- script.Parent.Velocity = dir*30
- end
- end))
- Script34.Disabled = true
- Vector3Value35.Parent = Script34
- Script36.Parent = Part31
- table.insert(cors,sandbox(Script36,function()
- local hole = script.Parent
- local childList = {}
- local massConstant = 8 -- Generally a good value
- local mass = 32000 * 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:isA("BasePart") then
- if not obj.Anchored then
- childList[obj] = true
- end
- elseif obj:isA("Model") or obj:isA("Accoutrement") or obj:isA("Tool") then
- for _, child in ipairs(obj:GetChildren()) do
- checkObject(child)
- end
- obj.ChildAdded:connect(checkObject)
- end
- end
- checkObject(workspace)
- print("Black Hole script loaded.")
- while true do
- for child in pairs(childList) do
- local distance = (hole.Position - child.Position).magnitude
- local motivator = child:FindFirstChild("BlackHole Influence")
- if distance * 240 * massConstant < mass then
- child:BreakJoints()
- if distance * 320 * massConstant < mass and child.Size.z + hole.Size.x > distance * 2 - 4 then
- mass = mass + child:GetMass()
- childList[child] = nil
- child:Remove()
- else
- child.CanCollide = false -- I Can assume that things won't escape the black hole.
- if not motivator 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() / (distance * massConstant)
- end
- elseif motivator ~= nil then
- motivator:Remove()
- end
- end
- wait()
- 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