Advertisement
firebudgy

Untitled

May 21st, 2018
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 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. Part0 = Instance.new("Part")
  20. SpecialMesh1 = Instance.new("SpecialMesh")
  21. Script2 = Instance.new("Script")
  22. Part0.Name = "Black Hole"
  23. Part0.Parent = mas
  24. Part0.Material = Enum.Material.Slate
  25. Part0.BrickColor = BrickColor.new("Really black")
  26. Part0.Rotation = Vector3.new(0, 0, -90)
  27. Part0.Anchored = true
  28. Part0.CanCollide = false
  29. Part0.FormFactor = Enum.FormFactor.Symmetric
  30. Part0.Shape = Enum.PartType.Ball
  31. Part0.Size = Vector3.new(8, 8, 8)
  32. Part0.CFrame = CFrame.new(26.5999985, 43.9998131, -12.5999985, 0, 1, 0, -1, 0, 0, 0, 0, 1)
  33. Part0.BottomSurface = Enum.SurfaceType.Smooth
  34. Part0.TopSurface = Enum.SurfaceType.Smooth
  35. Part0.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  36. Part0.Position = Vector3.new(26.5999985, 43.9998131, -12.5999985)
  37. Part0.Orientation = Vector3.new(0, 0, -90)
  38. Part0.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  39. SpecialMesh1.Parent = Part0
  40. SpecialMesh1.MeshType = Enum.MeshType.Sphere
  41. Script2.Parent = Part0
  42. table.insert(cors,sandbox(Script2,function()
  43. EffectRadius = 50
  44.  
  45. maximumAffectedMass = 300
  46.  
  47. dragForce = 30
  48.  
  49. willKillPlayers = false
  50.  
  51. hole = script.Parent
  52.  
  53. local veloRef = Instance.new("BodyPosition")
  54. veloRef.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  55. veloRef.Name = "Black Hole Influence"
  56.  
  57. function getHumanoid(model)
  58. for i,v in pairs(model:getChildren()) do
  59. if v.className == "Humanoid" then
  60. return v
  61. end
  62. end
  63. return nil
  64. end
  65.  
  66. parts = {}
  67. function getBricks(bin)
  68. for i,child in pairs(bin:getChildren()) do
  69. if child.className == "Part" or child.className == "TrussPart" or child.className == "Seat" then
  70. if (child.Position - hole.Position).magnitude <= EffectRadius and child:findFirstChild(veloRef.Name) == nil and child:getMass() <= maximumAffectedMass and child ~= hole then
  71. if getHumanoid(child.Parent) ~= nil and not willKillPlayers then
  72. if child.Name == "Torso" then
  73. table.insert(parts, child)
  74. end
  75. else
  76. table.insert(parts, child)
  77. end
  78. end
  79. elseif child.className == "Model" then
  80. print("Model")
  81. getBricks(child)
  82. end
  83. end
  84. end
  85.  
  86. function onTouch(hit)
  87. if hit.Anchored == false then
  88. hit:remove()
  89. end
  90. end
  91.  
  92. hole.Touched:connect(onTouch)
  93.  
  94. while true do
  95. wait(0.5)
  96. parts = {}
  97. getBricks(workspace)
  98. for i,brick in pairs(parts) do
  99. if brick.Name ~= "Torso" then
  100. brick:breakJoints()
  101. brick.CanCollide = false
  102. end
  103. local velo = veloRef:clone()
  104. velo.P = dragForce * 100
  105. velo.position = hole.Position
  106. velo.Parent = brick
  107. end
  108. end
  109.  
  110. end))
  111. for i,v in pairs(mas:GetChildren()) do
  112. v.Parent = workspace
  113. pcall(function() v:MakeJoints() end)
  114. end
  115. mas:Destroy()
  116. for i,v in pairs(cors) do
  117. spawn(function()
  118. pcall(v)
  119. end)
  120. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement