Advertisement
Guest User

black hole

a guest
Nov 7th, 2019
4,461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.32 KB | None | 0 0
  1. function sandbox(var,func)
  2. local env = getfenv(func)
  3. local newenv = setmetatable({},{
  4. __index = function(self,k)
  5. if k=="script" then
  6. return var
  7. else
  8. return env[k]
  9. end
  10. end,
  11. })
  12. setfenv(func,newenv)
  13. return func
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. Model0 = Instance.new("Model")
  18. Part1 = Instance.new("Part")
  19. Script2 = Instance.new("Script")
  20. ParticleEmitter3 = Instance.new("ParticleEmitter")
  21. ParticleEmitter4 = Instance.new("ParticleEmitter")
  22. Script5 = Instance.new("Script")
  23. Script6 = Instance.new("Script")
  24. Vector3Value7 = Instance.new("Vector3Value")
  25. Part8 = Instance.new("Part")
  26. Script9 = Instance.new("Script")
  27. Script10 = Instance.new("Script")
  28. Script11 = Instance.new("Script")
  29. Vector3Value12 = Instance.new("Vector3Value")
  30. ParticleEmitter13 = Instance.new("ParticleEmitter")
  31. ParticleEmitter14 = Instance.new("ParticleEmitter")
  32. ParticleEmitter15 = Instance.new("ParticleEmitter")
  33. ParticleEmitter16 = Instance.new("ParticleEmitter")
  34. Part17 = Instance.new("Part")
  35. Script18 = Instance.new("Script")
  36. ParticleEmitter19 = Instance.new("ParticleEmitter")
  37. Script20 = Instance.new("Script")
  38. Script21 = Instance.new("Script")
  39. Vector3Value22 = Instance.new("Vector3Value")
  40. ParticleEmitter23 = Instance.new("ParticleEmitter")
  41. ParticleEmitter24 = Instance.new("ParticleEmitter")
  42. ParticleEmitter25 = Instance.new("ParticleEmitter")
  43. Part26 = Instance.new("Part")
  44. ParticleEmitter27 = Instance.new("ParticleEmitter")
  45. Script28 = Instance.new("Script")
  46. Script29 = Instance.new("Script")
  47. Vector3Value30 = Instance.new("Vector3Value")
  48. Part31 = Instance.new("Part")
  49. ParticleEmitter32 = Instance.new("ParticleEmitter")
  50. Script33 = Instance.new("Script")
  51. Script34 = Instance.new("Script")
  52. Vector3Value35 = Instance.new("Vector3Value")
  53. Script36 = Instance.new("Script")
  54. Model0.Name = "Black Hole"
  55. Model0.Parent = mas
  56. Model0.PrimaryPart = Part17
  57. Part1.Name = "Quasars"
  58. Part1.Parent = Model0
  59. Part1.CFrame = CFrame.new(-40.9709282, 144.504608, -28.8558464, 0.535559833, -0.25882259, 0.803857327, 0.143504083, 0.965924919, 0.215396628, -0.832215309, -9.87319368e-07, 0.554452658)
  60. Part1.Orientation = Vector3.new(-12.4399996, 55.4000015, 8.44999981)
  61. Part1.Position = Vector3.new(-40.9709282, 144.504608, -28.8558464)
  62. Part1.Rotation = Vector3.new(-21.2299995, 53.5, 25.7900009)
  63. Part1.Color = Color3.new(0, 1, 1)
  64. Part1.Transparency = 1
  65. Part1.Size = Vector3.new(2, 1, 2)
  66. Part1.Anchored = true
  67. Part1.BottomSurface = Enum.SurfaceType.Smooth
  68. Part1.BrickColor = BrickColor.new("Toothpaste")
  69. Part1.CanCollide = false
  70. Part1.Material = Enum.Material.Neon
  71. Part1.TopSurface = Enum.SurfaceType.Smooth
  72. Part1.brickColor = BrickColor.new("Toothpaste")
  73. Script2.Parent = Part1
  74. table.insert(cors,sandbox(Script2,function()
  75. while wait(0.0001) do
  76. script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
  77. end
  78. end))
  79. ParticleEmitter3.Parent = Part1
  80. ParticleEmitter3.Speed = NumberRange.new(50, 50)
  81. ParticleEmitter3.Color = ColorSequence.new(Color3.new(0.333333, 0, 1),Color3.new(0.333333, 0, 1))
  82. ParticleEmitter3.LightEmission = 1
  83. ParticleEmitter3.Texture = "rbxassetid://81137714"
  84. ParticleEmitter3.Transparency = NumberSequence.new(0.5,0.5)
  85. ParticleEmitter3.Size = NumberSequence.new(0.87499976158142,2.3125,0.43749988079071)
  86. ParticleEmitter3.Lifetime = NumberRange.new(1, 1)
  87. ParticleEmitter3.Rate = 1000
  88. ParticleEmitter3.SpreadAngle = Vector2.new(2, 2)
  89. ParticleEmitter3.VelocitySpread = 2
  90. ParticleEmitter4.Parent = Part1
  91. ParticleEmitter4.Speed = NumberRange.new(50, 50)
  92. ParticleEmitter4.Color = ColorSequence.new(Color3.new(0.333333, 0, 1),Color3.new(0.333333, 0, 1))
  93. ParticleEmitter4.LightEmission = 1
  94. ParticleEmitter4.Texture = "rbxassetid://81137714"
  95. ParticleEmitter4.Transparency = NumberSequence.new(0.5,0.5)
  96. ParticleEmitter4.Size = NumberSequence.new(0.87499976158142,2.3125,0.43749988079071)
  97. ParticleEmitter4.EmissionDirection = Enum.NormalId.Bottom
  98. ParticleEmitter4.Lifetime = NumberRange.new(1, 1)
  99. ParticleEmitter4.Rate = 1000
  100. ParticleEmitter4.SpreadAngle = Vector2.new(2, 2)
  101. ParticleEmitter4.VelocitySpread = 2
  102. Script5.Name = "attract"
  103. Script5.Parent = Part1
  104. table.insert(cors,sandbox(Script5,function()
  105. local hole = script.Parent
  106. local childList = {}
  107.  
  108. local massConstant = 888888 -- Generally a good value
  109.  
  110. local mass = 40000 * massConstant
  111.  
  112. -- This is basically a function that finds all unanchored parts and adds them to childList.
  113. -- Note: This should only be run once for each object
  114. function checkObject(obj)
  115. if (obj ~= hole) and (obj.className == "Part") then
  116. if (obj.Anchored == false) then
  117. table.insert(childList, 1, obj)
  118. end
  119. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  120. local child = obj:GetChildren()
  121. for x = 1, #child do
  122. checkObject(child[x])
  123. end
  124. obj.ChildAdded:connect(checkObject)
  125. end
  126. end
  127.  
  128. checkObject(workspace)
  129.  
  130. print("Black Hole script loaded.")
  131.  
  132. local n = 0
  133. while true do
  134. if n < #childList then
  135. n = n + 1
  136. if n % 800 == 0 then
  137. wait(0.5)
  138. end
  139. else
  140. n = 1
  141. wait(0.5)
  142. end
  143.  
  144. local child = childList[n]
  145. if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
  146. local relPos = hole.Position - child.Position
  147. local motivator = child:FindFirstChild("BlackHole Influence")
  148. if relPos.magnitude * 350 * massConstant < mass then
  149.  
  150. local a = math.random(1,4)
  151. if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
  152. child:BreakJoints()
  153.  
  154.  
  155. end
  156.  
  157. if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then
  158. mass = mass + child:GetMass()
  159. -- child:Remove()
  160. table.remove(childList, n)
  161. n = n - 1 -- This is the reason I need a counter of my own design
  162. else
  163. -- child.CanCollide = false -- I Can assume that things won't escape the black hole.
  164. if motivator == nil then
  165. motivator = Instance.new("BodyPosition")
  166. motivator.Parent = child
  167. --game:GetService("Debris"):AddItem(motivator,0.4)
  168. motivator.Name = "BlackHole Influence"
  169. end
  170. if child.Parent:findFirstChild("Humanoid") ~= nil then
  171. motivator.position = hole.Position
  172. motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  173. motivator:remove()
  174. local posfind = child.Parent:findFirstChild("Torso")
  175. if posfind ~= nil then
  176. local posfind2 = posfind:findFirstChild("gotopos")
  177. if posfind2== nil then
  178. aa= script.gotopos:Clone()
  179. aa.Disabled=false
  180. game:GetService("Debris"):AddItem(aa,10)
  181. aa.Value.Value=script.Parent.Position
  182. aa.Parent=child.Parent.Torso
  183. end
  184. end
  185. else
  186. motivator.position = hole.Position
  187. motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  188.  
  189. end
  190.  
  191. end
  192. elseif motivator ~= nil then
  193. motivator:Remove()
  194. end
  195. end
  196. end
  197. end))
  198. Script6.Name = "gotopos"
  199. Script6.Parent = Script5
  200. table.insert(cors,sandbox(Script6,function()
  201. print 'Hello world!'
  202. local b = script.Value.Value
  203. while true do
  204. wait(0.1)
  205.  
  206. local a = script.Parent.Position
  207.  
  208. local dir = (a - b).unit
  209. dir=dir*-1
  210. script.Parent.Velocity = dir*50
  211. end
  212. end))
  213. Script6.Disabled = true
  214. Vector3Value7.Parent = Script6
  215. Part8.Name = "Rings"
  216. Part8.Parent = Model0
  217. Part8.CFrame = CFrame.new(-40.9709282, 144.504608, -28.8558464, 0.949450195, -0.258822143, 0.17763859, 0.254407436, 0.965924978, 0.0475999936, -0.183905482, -1.2401407e-06, 0.982943952)
  218. Part8.Orientation = Vector3.new(-2.73000002, 10.2399998, 14.7600002)
  219. Part8.Position = Vector3.new(-40.9709282, 144.504608, -28.8558464)
  220. Part8.Rotation = Vector3.new(-2.76999998, 10.2299995, 15.25)
  221. Part8.Color = Color3.new(0, 1, 1)
  222. Part8.Transparency = 1
  223. Part8.Size = Vector3.new(2, 1, 2)
  224. Part8.Anchored = true
  225. Part8.BottomSurface = Enum.SurfaceType.Smooth
  226. Part8.BrickColor = BrickColor.new("Toothpaste")
  227. Part8.CanCollide = false
  228. Part8.Material = Enum.Material.Neon
  229. Part8.TopSurface = Enum.SurfaceType.Smooth
  230. Part8.brickColor = BrickColor.new("Toothpaste")
  231. Script9.Parent = Part8
  232. table.insert(cors,sandbox(Script9,function()
  233. while wait(0.0001) do
  234. script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
  235. end
  236. end))
  237. Script10.Name = "attract"
  238. Script10.Parent = Part8
  239. table.insert(cors,sandbox(Script10,function()
  240. local hole = script.Parent
  241. local childList = {}
  242.  
  243. local massConstant = 5.8 -- Generally a good value
  244.  
  245. local mass = 40000 * massConstant
  246.  
  247. -- This is basically a function that finds all unanchored parts and adds them to childList.
  248. -- Note: This should only be run once for each object
  249. function checkObject(obj)
  250. if (obj ~= hole) and (obj.className == "Part") then
  251. if (obj.Anchored == false) then
  252. table.insert(childList, 1, obj)
  253. end
  254. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  255. local child = obj:GetChildren()
  256. for x = 1, #child do
  257. checkObject(child[x])
  258. end
  259. obj.ChildAdded:connect(checkObject)
  260. end
  261. end
  262.  
  263. checkObject(workspace)
  264.  
  265. print("Black Hole script loaded.")
  266.  
  267. local n = 0
  268. while true do
  269. if n < #childList then
  270. n = n + 1
  271. if n % 800 == 0 then
  272. wait(0.5)
  273. end
  274. else
  275. n = 1
  276. wait(0.5)
  277. end
  278.  
  279. local child = childList[n]
  280. if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
  281. local relPos = hole.Position - child.Position
  282. local motivator = child:FindFirstChild("BlackHole Influence")
  283. if relPos.magnitude * 350 * massConstant < mass then
  284.  
  285. local a = math.random(1,4)
  286. if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
  287. child:BreakJoints()
  288.  
  289.  
  290. end
  291.  
  292. if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then
  293. mass = mass + child:GetMass()
  294. -- child:Remove()
  295. table.remove(childList, n)
  296. n = n - 1 -- This is the reason I need a counter of my own design
  297. else
  298. -- child.CanCollide = false -- I Can assume that things won't escape the black hole.
  299. if motivator == nil then
  300. motivator = Instance.new("BodyPosition")
  301. motivator.Parent = child
  302. --game:GetService("Debris"):AddItem(motivator,0.4)
  303. motivator.Name = "BlackHole Influence"
  304. end
  305. if child.Parent:findFirstChild("Humanoid") ~= nil then
  306. motivator.position = hole.Position
  307. motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  308. motivator:remove()
  309. local posfind = child.Parent:findFirstChild("Torso")
  310. if posfind ~= nil then
  311. local posfind2 = posfind:findFirstChild("gotopos")
  312. if posfind2== nil then
  313. aa= script.gotopos:Clone()
  314. aa.Disabled=false
  315. game:GetService("Debris"):AddItem(aa,10)
  316. aa.Value.Value=script.Parent.Position
  317. aa.Parent=child.Parent.Torso
  318. end
  319. end
  320. else
  321. motivator.position = hole.Position
  322. motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  323.  
  324. end
  325.  
  326. end
  327. elseif motivator ~= nil then
  328. motivator:Remove()
  329. end
  330. end
  331. end
  332. end))
  333. Script11.Name = "gotopos"
  334. Script11.Parent = Script10
  335. table.insert(cors,sandbox(Script11,function()
  336. print 'Hello world!'
  337. local b = script.Value.Value
  338. while true do
  339. wait(0.1)
  340.  
  341. local a = script.Parent.Position
  342.  
  343. local dir = (a - b).unit
  344. dir=dir*-1
  345. script.Parent.Velocity = dir*30
  346. end
  347. end))
  348. Script11.Disabled = true
  349. Vector3Value12.Parent = Script11
  350. ParticleEmitter13.Parent = Part8
  351. ParticleEmitter13.Speed = NumberRange.new(1, 1)
  352. ParticleEmitter13.Color = ColorSequence.new(Color3.new(0.987366, 0.242267, 0.0729076),Color3.new(0.987366, 0.242267, 0.0729076))
  353. ParticleEmitter13.LightEmission = 0.80000001192093
  354. ParticleEmitter13.Texture = "rbxassetid://254959503"
  355. ParticleEmitter13.EmissionDirection = Enum.NormalId.Right
  356. ParticleEmitter13.Lifetime = NumberRange.new(3, 3)
  357. ParticleEmitter13.Rate = 250
  358. ParticleEmitter14.Parent = Part8
  359. ParticleEmitter14.Speed = NumberRange.new(1, 1)
  360. ParticleEmitter14.Color = ColorSequence.new(Color3.new(0.987366, 0.242267, 0.0729076),Color3.new(0.987366, 0.242267, 0.0729076))
  361. ParticleEmitter14.LightEmission = 0.80000001192093
  362. ParticleEmitter14.Texture = "rbxassetid://254959503"
  363. ParticleEmitter14.EmissionDirection = Enum.NormalId.Left
  364. ParticleEmitter14.Lifetime = NumberRange.new(3, 3)
  365. ParticleEmitter14.Rate = 250
  366. ParticleEmitter15.Parent = Part8
  367. ParticleEmitter15.Speed = NumberRange.new(1, 1)
  368. ParticleEmitter15.Color = ColorSequence.new(Color3.new(0.987366, 0.242267, 0.0729076),Color3.new(0.987366, 0.242267, 0.0729076))
  369. ParticleEmitter15.LightEmission = 0.80000001192093
  370. ParticleEmitter15.Texture = "rbxassetid://254959503"
  371. ParticleEmitter15.EmissionDirection = Enum.NormalId.Front
  372. ParticleEmitter15.Lifetime = NumberRange.new(3, 3)
  373. ParticleEmitter15.Rate = 250
  374. ParticleEmitter16.Parent = Part8
  375. ParticleEmitter16.Speed = NumberRange.new(1, 1)
  376. ParticleEmitter16.Color = ColorSequence.new(Color3.new(0.987366, 0.242267, 0.0729076),Color3.new(0.987366, 0.242267, 0.0729076))
  377. ParticleEmitter16.LightEmission = 0.80000001192093
  378. ParticleEmitter16.Texture = "rbxassetid://254959503"
  379. ParticleEmitter16.EmissionDirection = Enum.NormalId.Back
  380. ParticleEmitter16.Lifetime = NumberRange.new(3, 3)
  381. ParticleEmitter16.Rate = 250
  382. Part17.Name = "Rings"
  383. Part17.Parent = Model0
  384. Part17.CFrame = CFrame.new(-40.9709282, 144.504608, -28.8558464, 0.613136113, -0.25882259, 0.746374547, 0.164290935, 0.965924919, 0.199994043, -0.772704661, -9.96810172e-07, 0.634765685)
  385. Part17.Orientation = Vector3.new(-11.54, 49.6199989, 9.64999962)
  386. Part17.Position = Vector3.new(-40.9709282, 144.504608, -28.8558464)
  387. Part17.Rotation = Vector3.new(-17.4899998, 48.2799988, 22.8899994)
  388. Part17.Color = Color3.new(0, 1, 1)
  389. Part17.Transparency = 1
  390. Part17.Size = Vector3.new(2, 1, 2)
  391. Part17.Anchored = true
  392. Part17.BottomSurface = Enum.SurfaceType.Smooth
  393. Part17.BrickColor = BrickColor.new("Toothpaste")
  394. Part17.CanCollide = false
  395. Part17.Material = Enum.Material.Neon
  396. Part17.TopSurface = Enum.SurfaceType.Smooth
  397. Part17.brickColor = BrickColor.new("Toothpaste")
  398. Script18.Parent = Part17
  399. table.insert(cors,sandbox(Script18,function()
  400. while wait(0.0001) do
  401. script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
  402. end
  403. end))
  404. ParticleEmitter19.Parent = Part17
  405. ParticleEmitter19.Speed = NumberRange.new(1, 1)
  406. ParticleEmitter19.Color = ColorSequence.new(Color3.new(0.987366, 0.242267, 0.0729076),Color3.new(0.987366, 0.242267, 0.0729076))
  407. ParticleEmitter19.LightEmission = 0.80000001192093
  408. ParticleEmitter19.Texture = "rbxassetid://254959503"
  409. ParticleEmitter19.EmissionDirection = Enum.NormalId.Right
  410. ParticleEmitter19.Lifetime = NumberRange.new(3, 3)
  411. ParticleEmitter19.Rate = 250
  412. Script20.Name = "attract"
  413. Script20.Parent = Part17
  414. table.insert(cors,sandbox(Script20,function()
  415. local hole = script.Parent
  416. local childList = {}
  417.  
  418. local massConstant = 5.8 -- Generally a good value
  419.  
  420. local mass = 40000 * massConstant
  421.  
  422. -- This is basically a function that finds all unanchored parts and adds them to childList.
  423. -- Note: This should only be run once for each object
  424. function checkObject(obj)
  425. if (obj ~= hole) and (obj.className == "Part") then
  426. if (obj.Anchored == false) then
  427. table.insert(childList, 1, obj)
  428. end
  429. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  430. local child = obj:GetChildren()
  431. for x = 1, #child do
  432. checkObject(child[x])
  433. end
  434. obj.ChildAdded:connect(checkObject)
  435. end
  436. end
  437.  
  438. checkObject(workspace)
  439.  
  440. print("Black Hole script loaded.")
  441.  
  442. local n = 0
  443. while true do
  444. if n < #childList then
  445. n = n + 1
  446. if n % 800 == 0 then
  447. wait(0.5)
  448. end
  449. else
  450. n = 1
  451. wait(0.5)
  452. end
  453.  
  454. local child = childList[n]
  455. if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
  456. local relPos = hole.Position - child.Position
  457. local motivator = child:FindFirstChild("BlackHole Influence")
  458. if relPos.magnitude * 350 * massConstant < mass then
  459.  
  460. local a = math.random(1,4)
  461. if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
  462. child:BreakJoints()
  463.  
  464.  
  465. end
  466.  
  467. if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then
  468. mass = mass + child:GetMass()
  469. -- child:Remove()
  470. table.remove(childList, n)
  471. n = n - 1 -- This is the reason I need a counter of my own design
  472. else
  473. -- child.CanCollide = false -- I Can assume that things won't escape the black hole.
  474. if motivator == nil then
  475. motivator = Instance.new("BodyPosition")
  476. motivator.Parent = child
  477. --game:GetService("Debris"):AddItem(motivator,0.4)
  478. motivator.Name = "BlackHole Influence"
  479. end
  480. if child.Parent:findFirstChild("Humanoid") ~= nil then
  481. motivator.position = hole.Position
  482. motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  483. motivator:remove()
  484. local posfind = child.Parent:findFirstChild("Torso")
  485. if posfind ~= nil then
  486. local posfind2 = posfind:findFirstChild("gotopos")
  487. if posfind2== nil then
  488. aa= script.gotopos:Clone()
  489. aa.Disabled=false
  490. game:GetService("Debris"):AddItem(aa,10)
  491. aa.Value.Value=script.Parent.Position
  492. aa.Parent=child.Parent.Torso
  493. end
  494. end
  495. else
  496. motivator.position = hole.Position
  497. motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  498.  
  499. end
  500.  
  501. end
  502. elseif motivator ~= nil then
  503. motivator:Remove()
  504. end
  505. end
  506. end
  507. end))
  508. Script21.Name = "gotopos"
  509. Script21.Parent = Script20
  510. table.insert(cors,sandbox(Script21,function()
  511. print 'Hello world!'
  512. local b = script.Value.Value
  513. while true do
  514. wait(0.1)
  515.  
  516. local a = script.Parent.Position
  517.  
  518. local dir = (a - b).unit
  519. dir=dir*-1
  520. script.Parent.Velocity = dir*30
  521. end
  522. end))
  523. Script21.Disabled = true
  524. Vector3Value22.Parent = Script21
  525. ParticleEmitter23.Parent = Part17
  526. ParticleEmitter23.Speed = NumberRange.new(1, 1)
  527. ParticleEmitter23.Color = ColorSequence.new(Color3.new(0.987366, 0.242267, 0.0729076),Color3.new(0.987366, 0.242267, 0.0729076))
  528. ParticleEmitter23.LightEmission = 0.80000001192093
  529. ParticleEmitter23.Texture = "rbxassetid://254959503"
  530. ParticleEmitter23.EmissionDirection = Enum.NormalId.Left
  531. ParticleEmitter23.Lifetime = NumberRange.new(3, 3)
  532. ParticleEmitter23.Rate = 250
  533. ParticleEmitter24.Parent = Part17
  534. ParticleEmitter24.Speed = NumberRange.new(1, 1)
  535. ParticleEmitter24.Color = ColorSequence.new(Color3.new(0.987366, 0.242267, 0.0729076),Color3.new(0.987366, 0.242267, 0.0729076))
  536. ParticleEmitter24.LightEmission = 0.80000001192093
  537. ParticleEmitter24.Texture = "rbxassetid://254959503"
  538. ParticleEmitter24.EmissionDirection = Enum.NormalId.Front
  539. ParticleEmitter24.Lifetime = NumberRange.new(3, 3)
  540. ParticleEmitter24.Rate = 250
  541. ParticleEmitter25.Parent = Part17
  542. ParticleEmitter25.Speed = NumberRange.new(1, 1)
  543. ParticleEmitter25.Color = ColorSequence.new(Color3.new(0.987366, 0.242267, 0.0729076),Color3.new(0.987366, 0.242267, 0.0729076))
  544. ParticleEmitter25.LightEmission = 0.80000001192093
  545. ParticleEmitter25.Texture = "rbxassetid://254959503"
  546. ParticleEmitter25.EmissionDirection = Enum.NormalId.Back
  547. ParticleEmitter25.Lifetime = NumberRange.new(3, 3)
  548. ParticleEmitter25.Rate = 250
  549. Part26.Name = "Shine"
  550. Part26.Parent = Model0
  551. Part26.CFrame = CFrame.new(-41.081768, 144.679413, -28.8558311, 0.965932727, -0.258822411, -5.09619713e-06, 0.258824348, 0.965925038, -2.98023224e-07, 5.7220459e-06, -1.19278945e-06, 1.00000739)
  552. Part26.Orientation = Vector3.new(0, 0, 15)
  553. Part26.Position = Vector3.new(-41.081768, 144.679413, -28.8558311)
  554. Part26.Rotation = Vector3.new(0, 0, 15)
  555. Part26.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  556. Part26.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  557. Part26.Anchored = true
  558. Part26.BottomSurface = Enum.SurfaceType.Smooth
  559. Part26.BrickColor = BrickColor.new("Really black")
  560. Part26.CanCollide = false
  561. Part26.FrontParamA = 0
  562. Part26.FrontParamB = 0
  563. Part26.Material = Enum.Material.SmoothPlastic
  564. Part26.TopSurface = Enum.SurfaceType.Smooth
  565. Part26.brickColor = BrickColor.new("Really black")
  566. Part26.Shape = Enum.PartType.Ball
  567. ParticleEmitter27.Parent = Part26
  568. ParticleEmitter27.Speed = NumberRange.new(0, 0)
  569. ParticleEmitter27.Color = ColorSequence.new(Color3.new(0.974243, 0.544472, 0.0839246),Color3.new(0.974243, 0.544472, 0.0839246))
  570. ParticleEmitter27.LightEmission = 0.69999998807907
  571. ParticleEmitter27.Texture = "rbxassetid://286708119"
  572. ParticleEmitter27.Size = NumberSequence.new(2.5,2.5)
  573. ParticleEmitter27.EmissionDirection = Enum.NormalId.Front
  574. ParticleEmitter27.Lifetime = NumberRange.new(0.10000000149012, 0.10000000149012)
  575. ParticleEmitter27.Rate = 1000
  576. Script28.Name = "attract"
  577. Script28.Parent = Part26
  578. table.insert(cors,sandbox(Script28,function()
  579. local hole = script.Parent
  580. local childList = {}
  581.  
  582. local massConstant = 5.8 -- Generally a good value
  583.  
  584. local mass = 40000 * massConstant
  585.  
  586. -- This is basically a function that finds all unanchored parts and adds them to childList.
  587. -- Note: This should only be run once for each object
  588. function checkObject(obj)
  589. if (obj ~= hole) and (obj.className == "Part") then
  590. if (obj.Anchored == false) then
  591. table.insert(childList, 1, obj)
  592. end
  593. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  594. local child = obj:GetChildren()
  595. for x = 1, #child do
  596. checkObject(child[x])
  597. end
  598. obj.ChildAdded:connect(checkObject)
  599. end
  600. end
  601.  
  602. checkObject(workspace)
  603.  
  604. print("Black Hole script loaded.")
  605.  
  606. local n = 0
  607. while true do
  608. if n < #childList then
  609. n = n + 1
  610. if n % 800 == 0 then
  611. wait(0.5)
  612. end
  613. else
  614. n = 1
  615. wait(0.5)
  616. end
  617.  
  618. local child = childList[n]
  619. if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
  620. local relPos = hole.Position - child.Position
  621. local motivator = child:FindFirstChild("BlackHole Influence")
  622. if relPos.magnitude * 350 * massConstant < mass then
  623.  
  624. local a = math.random(1,4)
  625. if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
  626. child:BreakJoints()
  627.  
  628.  
  629. end
  630.  
  631. if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then
  632. mass = mass + child:GetMass()
  633. -- child:Remove()
  634. table.remove(childList, n)
  635. n = n - 1 -- This is the reason I need a counter of my own design
  636. else
  637. -- child.CanCollide = false -- I Can assume that things won't escape the black hole.
  638. if motivator == nil then
  639. motivator = Instance.new("BodyPosition")
  640. motivator.Parent = child
  641. --game:GetService("Debris"):AddItem(motivator,0.4)
  642. motivator.Name = "BlackHole Influence"
  643. end
  644. if child.Parent:findFirstChild("Humanoid") ~= nil then
  645. motivator.position = hole.Position
  646. motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  647. motivator:remove()
  648. local posfind = child.Parent:findFirstChild("Torso")
  649. if posfind ~= nil then
  650. local posfind2 = posfind:findFirstChild("gotopos")
  651. if posfind2== nil then
  652. aa= script.gotopos:Clone()
  653. aa.Disabled=false
  654. game:GetService("Debris"):AddItem(aa,10)
  655. aa.Value.Value=script.Parent.Position
  656. aa.Parent=child.Parent.Torso
  657. end
  658. end
  659. else
  660. motivator.position = hole.Position
  661. motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  662.  
  663. end
  664.  
  665. end
  666. elseif motivator ~= nil then
  667. motivator:Remove()
  668. end
  669. end
  670. end
  671. end))
  672. Script29.Name = "gotopos"
  673. Script29.Parent = Script28
  674. table.insert(cors,sandbox(Script29,function()
  675. print 'Hello world!'
  676. local b = script.Value.Value
  677. while true do
  678. wait(0.1)
  679.  
  680. local a = script.Parent.Position
  681.  
  682. local dir = (a - b).unit
  683. dir=dir*-1
  684. script.Parent.Velocity = dir*30
  685. end
  686. end))
  687. Script29.Disabled = true
  688. Vector3Value30.Parent = Script29
  689. Part31.Name = "Singularity"
  690. Part31.Parent = Model0
  691. Part31.CFrame = CFrame.new(-41.081768, 144.61203, -28.8558464, 0.965932727, -0.258822411, -5.09619713e-06, 0.258824348, 0.965925038, -2.98023224e-07, 5.7220459e-06, -1.19278945e-06, 1.00000739)
  692. Part31.Orientation = Vector3.new(0, 0, 15)
  693. Part31.Position = Vector3.new(-41.081768, 144.61203, -28.8558464)
  694. Part31.Rotation = Vector3.new(0, 0, 15)
  695. Part31.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  696. Part31.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  697. Part31.Anchored = true
  698. Part31.BottomSurface = Enum.SurfaceType.Smooth
  699. Part31.BrickColor = BrickColor.new("Really black")
  700. Part31.CanCollide = false
  701. Part31.FrontParamA = 0
  702. Part31.FrontParamB = 0
  703. Part31.Material = Enum.Material.SmoothPlastic
  704. Part31.TopSurface = Enum.SurfaceType.Smooth
  705. Part31.brickColor = BrickColor.new("Really black")
  706. Part31.Shape = Enum.PartType.Ball
  707. ParticleEmitter32.Parent = Part31
  708. ParticleEmitter32.Speed = NumberRange.new(0, 0)
  709. ParticleEmitter32.Color = ColorSequence.new(Color3.new(0, 0, 0),Color3.new(0, 0, 0))
  710. ParticleEmitter32.Texture = "rbxassetid://286708119"
  711. ParticleEmitter32.ZOffset = 1
  712. ParticleEmitter32.Size = NumberSequence.new(2.2000000476837,2.2000000476837)
  713. ParticleEmitter32.EmissionDirection = Enum.NormalId.Front
  714. ParticleEmitter32.Lifetime = NumberRange.new(0.10000000149012, 0.10000000149012)
  715. ParticleEmitter32.Rate = 1000
  716. Script33.Name = "attract"
  717. Script33.Parent = Part31
  718. table.insert(cors,sandbox(Script33,function()
  719. local hole = script.Parent
  720. local childList = {}
  721.  
  722. local massConstant = 5.8 -- Generally a good value
  723.  
  724. local mass = 40000 * massConstant
  725.  
  726. -- This is basically a function that finds all unanchored parts and adds them to childList.
  727. -- Note: This should only be run once for each object
  728. function checkObject(obj)
  729. if (obj ~= hole) and (obj.className == "Part") then
  730. if (obj.Anchored == false) then
  731. table.insert(childList, 1, obj)
  732. end
  733. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  734. local child = obj:GetChildren()
  735. for x = 1, #child do
  736. checkObject(child[x])
  737. end
  738. obj.ChildAdded:connect(checkObject)
  739. end
  740. end
  741.  
  742. checkObject(workspace)
  743.  
  744. print("Black Hole script loaded.")
  745.  
  746. local n = 0
  747. while true do
  748. if n < #childList then
  749. n = n + 1
  750. if n % 800 == 0 then
  751. wait(0.5)
  752. end
  753. else
  754. n = 1
  755. wait(0.5)
  756. end
  757.  
  758. local child = childList[n]
  759. if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
  760. local relPos = hole.Position - child.Position
  761. local motivator = child:FindFirstChild("BlackHole Influence")
  762. if relPos.magnitude * 350 * massConstant < mass then
  763.  
  764. local a = math.random(1,4)
  765. if a == 1 and child.Parent:findFirstChild("Humanoid") == nil then
  766. child:BreakJoints()
  767.  
  768.  
  769. end
  770.  
  771. if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then
  772. mass = mass + child:GetMass()
  773. -- child:Remove()
  774. table.remove(childList, n)
  775. n = n - 1 -- This is the reason I need a counter of my own design
  776. else
  777. -- child.CanCollide = false -- I Can assume that things won't escape the black hole.
  778. if motivator == nil then
  779. motivator = Instance.new("BodyPosition")
  780. motivator.Parent = child
  781. --game:GetService("Debris"):AddItem(motivator,0.4)
  782. motivator.Name = "BlackHole Influence"
  783. end
  784. if child.Parent:findFirstChild("Humanoid") ~= nil then
  785. motivator.position = hole.Position
  786. motivator.maxForce = Vector3.new(1000, 1000, 1000) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  787. motivator:remove()
  788. local posfind = child.Parent:findFirstChild("Torso")
  789. if posfind ~= nil then
  790. local posfind2 = posfind:findFirstChild("gotopos")
  791. if posfind2== nil then
  792. aa= script.gotopos:Clone()
  793. aa.Disabled=false
  794. game:GetService("Debris"):AddItem(aa,10)
  795. aa.Value.Value=script.Parent.Position
  796. aa.Parent=child.Parent.Torso
  797. end
  798. end
  799. else
  800. motivator.position = hole.Position
  801. motivator.maxForce = Vector3.new(1500, 1500, 1500) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  802.  
  803. end
  804.  
  805. end
  806. elseif motivator ~= nil then
  807. motivator:Remove()
  808. end
  809. end
  810. end
  811. end))
  812. Script34.Name = "gotopos"
  813. Script34.Parent = Script33
  814. table.insert(cors,sandbox(Script34,function()
  815. print 'Hello world!'
  816. local b = script.Value.Value
  817. while true do
  818. wait(0.1)
  819.  
  820. local a = script.Parent.Position
  821.  
  822. local dir = (a - b).unit
  823. dir=dir*-1
  824. script.Parent.Velocity = dir*30
  825. end
  826. end))
  827. Script34.Disabled = true
  828. Vector3Value35.Parent = Script34
  829. Script36.Parent = Part31
  830. table.insert(cors,sandbox(Script36,function()
  831. local hole = script.Parent
  832. local childList = {}
  833.  
  834. local massConstant = 8 -- Generally a good value
  835.  
  836. local mass = 32000 * massConstant
  837.  
  838. -- This is basically a function that finds all unanchored parts and adds them to childList.
  839. -- Note: This should only be run once for each object
  840. function checkObject(obj)
  841. if obj ~= hole and obj:isA("BasePart") then
  842. if not obj.Anchored then
  843. childList[obj] = true
  844. end
  845. elseif obj:isA("Model") or obj:isA("Accoutrement") or obj:isA("Tool") then
  846. for _, child in ipairs(obj:GetChildren()) do
  847. checkObject(child)
  848. end
  849. obj.ChildAdded:connect(checkObject)
  850. end
  851. end
  852.  
  853. checkObject(workspace)
  854.  
  855. print("Black Hole script loaded.")
  856.  
  857. while true do
  858. for child in pairs(childList) do
  859. local distance = (hole.Position - child.Position).magnitude
  860. local motivator = child:FindFirstChild("BlackHole Influence")
  861.  
  862. if distance * 240 * massConstant < mass then
  863. child:BreakJoints()
  864. if distance * 320 * massConstant < mass and child.Size.z + hole.Size.x > distance * 2 - 4 then
  865. mass = mass + child:GetMass()
  866. childList[child] = nil
  867. child:Remove()
  868. else
  869. child.CanCollide = false -- I Can assume that things won't escape the black hole.
  870. if not motivator then
  871. motivator = Instance.new("BodyPosition")
  872. motivator.Parent = child
  873. motivator.Name = "BlackHole Influence"
  874. end
  875. motivator.position = hole.Position
  876. motivator.maxForce = Vector3.new(1, 1, 1) * mass * child:GetMass() / (distance * massConstant)
  877. end
  878. elseif motivator ~= nil then
  879. motivator:Remove()
  880. end
  881. end
  882. wait()
  883. end
  884.  
  885. end))
  886. for i,v in pairs(mas:GetChildren()) do
  887. v.Parent = workspace
  888. pcall(function() v:MakeJoints() end)
  889. end
  890. mas:Destroy()
  891. for i,v in pairs(cors) do
  892. spawn(function()
  893. pcall(v)
  894. end)
  895. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement