Advertisement
Gamerulexerul

Untitled

Mar 24th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.65 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Model0 = Instance.new("Model")
  20. Part1 = Instance.new("Part")
  21. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Script3 = Instance.new("Script")
  23. Fire4 = Instance.new("Fire")
  24. Script5 = Instance.new("Script")
  25. Part6 = Instance.new("Part")
  26. SpecialMesh7 = Instance.new("SpecialMesh")
  27. Script8 = Instance.new("Script")
  28. Fire9 = Instance.new("Fire")
  29. Script10 = Instance.new("Script")
  30. Script11 = Instance.new("Script")
  31. Model0.Name = "BlackHole"
  32. Model0.Parent = mas
  33. Part1.Name = "H"
  34. Part1.Parent = Model0
  35. Part1.Transparency = 0.0099999997764826
  36. Part1.Rotation = Vector3.new(0, 0, -69.2600021)
  37. Part1.Anchored = true
  38. Part1.CanCollide = false
  39. Part1.FormFactor = Enum.FormFactor.Symmetric
  40. Part1.Size = Vector3.new(142.780136, 155.195801, 6.20783186)
  41. Part1.CFrame = CFrame.new(17.2116375, 50.9214897, 28.8960648, 0.354115248, 0.935203671, 0, -0.935203671, 0.354115248, 0, 0, 0, 1)
  42. Part1.BottomSurface = Enum.SurfaceType.Smooth
  43. Part1.TopSurface = Enum.SurfaceType.Smooth
  44. Part1.Position = Vector3.new(17.2116375, 50.9214897, 28.8960648)
  45. Part1.Orientation = Vector3.new(0, 0, -69.2600021)
  46. SpecialMesh2.Name = "planar1"
  47. SpecialMesh2.Parent = Part1
  48. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=1185246"
  49. SpecialMesh2.Scale = Vector3.new(1241.56714, 1241.56714, 0)
  50. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=21315275"
  51. SpecialMesh2.VertexColor = Vector3.new(0, 0, 0)
  52. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  53. SpecialMesh2.Scale = Vector3.new(1241.56714, 1241.56714, 0)
  54. Script3.Name = "spin"
  55. Script3.Parent = Part1
  56. table.insert(cors,sandbox(Script3,function()
  57. spinning = script.Parent
  58.  
  59. while true do
  60. spinning.CFrame = spinning.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(0), 0.2)
  61. wait()
  62. end
  63.  
  64. end))
  65. Fire4.Parent = Part1
  66. Fire4.Size = 30
  67. Fire4.Color = Color3.new(0, 0, 1)
  68. Fire4.Enabled = false
  69. Fire4.Heat = 25
  70. Fire4.SecondaryColor = Color3.new(1, 1, 1)
  71. Fire4.Color = Color3.new(0, 0, 1)
  72. Script5.Name = "Spread"
  73. Script5.Parent = Fire4
  74. table.insert(cors,sandbox(Script5,function()
  75. function Spread(part)
  76. check = part:findFirstChild("Fire")
  77. if check == nil then
  78. script.Parent:Clone().Parent = part
  79.  
  80. elseif check ~= nil then
  81. check.Size = check.Size + 1
  82. check.Heat = check.Heat +1
  83. end
  84. end
  85.  
  86.  
  87. script.Parent.Parent.Touched:connect(Spread)
  88.  
  89. end))
  90. Part6.Name = "H"
  91. Part6.Parent = Model0
  92. Part6.Transparency = 1
  93. Part6.Rotation = Vector3.new(-180, 0, 21.4099998)
  94. Part6.Anchored = true
  95. Part6.CanCollide = false
  96. Part6.FormFactor = Enum.FormFactor.Symmetric
  97. Part6.Size = Vector3.new(142.780136, 155.195801, 6.20783186)
  98. Part6.CFrame = CFrame.new(17.2224369, 50.9053879, 35.1039429, 0.931013227, -0.365007758, 0, -0.365007788, -0.931013346, 0, 0, 0, -1)
  99. Part6.BottomSurface = Enum.SurfaceType.Smooth
  100. Part6.TopSurface = Enum.SurfaceType.Smooth
  101. Part6.Position = Vector3.new(17.2224369, 50.9053879, 35.1039429)
  102. Part6.Orientation = Vector3.new(0, 180, -158.589996)
  103. SpecialMesh7.Name = "planar1"
  104. SpecialMesh7.Parent = Part6
  105. SpecialMesh7.MeshId = "http://www.roblox.com/asset/?id=1185246"
  106. SpecialMesh7.Scale = Vector3.new(1241.56714, 1241.56714, 0)
  107. SpecialMesh7.TextureId = "http://www.roblox.com/asset/?id=21315275"
  108. SpecialMesh7.VertexColor = Vector3.new(0, 0, 0)
  109. SpecialMesh7.MeshType = Enum.MeshType.FileMesh
  110. SpecialMesh7.Scale = Vector3.new(1241.56714, 1241.56714, 0)
  111. Script8.Name = "spin"
  112. Script8.Parent = Part6
  113. table.insert(cors,sandbox(Script8,function()
  114. spinning = script.Parent
  115.  
  116. while true do
  117. spinning.CFrame = spinning.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(0), 0.2)
  118. wait()
  119. end
  120.  
  121. end))
  122. Fire9.Parent = Part6
  123. Fire9.Size = 30
  124. Fire9.Color = Color3.new(0, 0, 1)
  125. Fire9.Enabled = false
  126. Fire9.Heat = 25
  127. Fire9.SecondaryColor = Color3.new(1, 1, 1)
  128. Fire9.Color = Color3.new(0, 0, 1)
  129. Script10.Name = "Spread"
  130. Script10.Parent = Fire9
  131. table.insert(cors,sandbox(Script10,function()
  132. function Spread(part)
  133. check = part:findFirstChild("Fire")
  134. if check == nil then
  135. script.Parent:Clone().Parent = part
  136.  
  137. elseif check ~= nil then
  138. check.Size = check.Size + 1
  139. check.Heat = check.Heat +1
  140. end
  141. end
  142.  
  143.  
  144. script.Parent.Parent.Touched:connect(Spread)
  145.  
  146. end))
  147. Script11.Parent = Part6
  148. table.insert(cors,sandbox(Script11,function()
  149. local hole = script.Parent
  150. local childList = {}
  151.  
  152. local massConstant = 5.8 -- Generally a good value
  153.  
  154. local mass = 32000 * massConstant
  155.  
  156. -- This is basically a function that finds all unanchored parts and adds them to childList.
  157. -- Note: This should only be run once for each object
  158. function checkObject(obj)
  159. if (obj ~= hole) and (obj.className == "Part") then
  160. if (obj.Anchored == false) then
  161. table.insert(childList, 1, obj)
  162. end
  163. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  164. local child = obj:GetChildren()
  165. for x = 1, #child do
  166. checkObject(child[x])
  167. end
  168. obj.ChildAdded:connect(checkObject)
  169. end
  170. end
  171.  
  172. checkObject(workspace)
  173.  
  174. print("Black Hole script loaded.")
  175.  
  176. local n = 0
  177. while true do
  178. if n < #childList then
  179. n = n + 1
  180. if n % 800 == 0 then
  181. wait()
  182. end
  183. else
  184. n = 1
  185. wait()
  186. end
  187.  
  188. local child = childList[n]
  189. if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
  190. local relPos = hole.Position - child.Position
  191. local motivator = child:FindFirstChild("BlackHole Influence")
  192. if relPos.magnitude * 240 * massConstant < mass then
  193. child:BreakJoints()
  194. if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then
  195. mass = mass + child:GetMass()
  196. child:Remove()
  197. table.remove(childList, n)
  198. n = n - 1 -- This is the reason I need a counter of my own design
  199. else
  200. child.CanCollide = false -- I Can assume that things won't escape the black hole.
  201. if motivator == nil then
  202. motivator = Instance.new("BodyPosition")
  203. motivator.Parent = child
  204. motivator.Name = "BlackHole Influence"
  205. end
  206. motivator.position = hole.Position
  207. motivator.maxForce = Vector3.new(1, 1, 1) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  208. end
  209. elseif motivator ~= nil then
  210. motivator:Remove()
  211. end
  212. end
  213. end
  214. end))
  215. for i,v in pairs(mas:GetChildren()) do
  216. v.Parent = workspace
  217. pcall(function() v:MakeJoints() end)
  218. end
  219. mas:Destroy()
  220. for i,v in pairs(cors) do
  221. spawn(function()
  222. pcall(v)
  223. end)
  224. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement