Advertisement
Diamond_Nicholas

cookie ball spawner

Feb 8th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1.  
  2. function sandbox(var,func)
  3. local env = getfenv(func)
  4. local newenv = setmetatable({},{
  5. __index = function(Enum,k)
  6. if k=="script" then
  7. return var
  8. else
  9. return env[k]
  10. end
  11. end,
  12. })
  13. setfenv(func,newenv)
  14. return func
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. Part0 = Instance.new("Part")
  19. Decal1 = Instance.new("Decal")
  20. Decal2 = Instance.new("Decal")
  21. Decal3 = Instance.new("Decal")
  22. Decal4 = Instance.new("Decal")
  23. Decal5 = Instance.new("Decal")
  24. Decal6 = Instance.new("Decal")
  25. Script7 = Instance.new("Script")
  26. Part0.Parent = mas
  27. Part0.CFrame = CFrame.new(-6.13871098, 423.500122, -11.4352522, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  28. Part0.Position = Vector3.new(-6.13871098, 423.500122, -11.4352522)
  29. Part0.Color = Color3.new(0.627451, 0.372549, 0.207843)
  30. Part0.Size = Vector3.new(7, 7, 7)
  31. Part0.Anchored = true
  32. Part0.BottomSurface = Enum.SurfaceType.Smooth
  33. Part0.BrickColor = BrickColor.new("Dark orange")
  34. Part0.Material = Enum.Material.SmoothPlastic
  35. Part0.TopSurface = Enum.SurfaceType.Smooth
  36. Part0.brickColor = BrickColor.new("Dark orange")
  37. Part0.FormFactor = Enum.FormFactor.Symmetric
  38. Part0.formFactor = Enum.FormFactor.Symmetric
  39. Part0.Shape = Enum.PartType.Ball
  40. Decal1.Name = "Cookie"
  41. Decal1.Parent = Part0
  42. Decal1.Texture = "http://www.roblox.com/asset/?id=19620465"
  43. Decal1.Face = Enum.NormalId.Back
  44. Decal2.Name = "Cookie"
  45. Decal2.Parent = Part0
  46. Decal2.Texture = "http://www.roblox.com/asset/?id=19620465"
  47. Decal2.Face = Enum.NormalId.Right
  48. Decal3.Name = "Cookie"
  49. Decal3.Parent = Part0
  50. Decal3.Texture = "http://www.roblox.com/asset/?id=19620465"
  51. Decal3.Face = Enum.NormalId.Top
  52. Decal4.Name = "Cookie"
  53. Decal4.Parent = Part0
  54. Decal4.Texture = "http://www.roblox.com/asset/?id=19620465"
  55. Decal4.Face = Enum.NormalId.Left
  56. Decal5.Name = "Cookie"
  57. Decal5.Parent = Part0
  58. Decal5.Texture = "http://www.roblox.com/asset/?id=19620465"
  59. Decal6.Name = "Cookie"
  60. Decal6.Parent = Part0
  61. Decal6.Texture = "http://www.roblox.com/asset/?id=19620465"
  62. Decal6.Face = Enum.NormalId.Bottom
  63. Script7.Parent = Part0
  64. table.insert(cors,sandbox(Script7,function()
  65. while true do
  66. wait()
  67. local clone = script.Parent:Clone()
  68. clone.Anchored = false
  69. clone.CanCollide = true
  70. clone.Parent = game.Workspace
  71. end
  72.  
  73. end))
  74. for i,v in pairs(mas:GetChildren()) do
  75. v.Parent = workspace
  76. pcall(function() v:MakeJoints() end)
  77. end
  78. for i,v in pairs(cors) do
  79. spawn(function()
  80. pcall(v)
  81. end)
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement