Advertisement
Diamond_Nicholas

tent and a tree

Feb 1st, 2020
710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 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. SpecialMesh1 = Instance.new("SpecialMesh")
  20. Part2 = Instance.new("Part")
  21. SpecialMesh3 = Instance.new("SpecialMesh")
  22. Part4 = Instance.new("Part")
  23. SpecialMesh5 = Instance.new("SpecialMesh")
  24. Script6 = Instance.new("Script")
  25. Part0.Parent = mas
  26. Part0.CFrame = CFrame.new(-7.3500061, 5.2971468, -10.7299805, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  27. Part0.Position = Vector3.new(-7.3500061, 5.2971468, -10.7299805)
  28. Part0.Size = Vector3.new(4, 1, 2)
  29. Part0.Anchored = true
  30. Part0.BottomSurface = Enum.SurfaceType.Smooth
  31. Part0.CanCollide = false
  32. Part0.TopSurface = Enum.SurfaceType.Smooth
  33. SpecialMesh1.Parent = Part0
  34. SpecialMesh1.MeshId = "rbxassetid://30554937"
  35. SpecialMesh1.Scale = Vector3.new(20, 20, 20)
  36. SpecialMesh1.TextureId = "rbxassetid://30554955"
  37. SpecialMesh1.MeshType = Enum.MeshType.FileMesh
  38. Part2.Parent = mas
  39. Part2.CFrame = CFrame.new(-22.5679169, 11.7399073, -10.7299805, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  40. Part2.Position = Vector3.new(-22.5679169, 11.7399073, -10.7299805)
  41. Part2.Size = Vector3.new(4, 1, 2)
  42. Part2.Anchored = true
  43. Part2.BottomSurface = Enum.SurfaceType.Smooth
  44. Part2.CanCollide = false
  45. Part2.TopSurface = Enum.SurfaceType.Smooth
  46. SpecialMesh3.Parent = Part2
  47. SpecialMesh3.MeshId = "rbxassetid://743205420"
  48. SpecialMesh3.Scale = Vector3.new(2, 2, 2)
  49. SpecialMesh3.TextureId = "rbxassetid://743204224"
  50. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  51. Part4.Parent = mas
  52. Part4.CFrame = CFrame.new(-22.9579182, 18.3630009, -10.8999796, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  53. Part4.Position = Vector3.new(-22.9579182, 18.3630009, -10.8999796)
  54. Part4.Transparency = 0.15000000596046
  55. Part4.Size = Vector3.new(13.4799976, 10.0500011, 8.06000042)
  56. Part4.Anchored = true
  57. Part4.BottomSurface = Enum.SurfaceType.Smooth
  58. Part4.CanCollide = false
  59. Part4.TopSurface = Enum.SurfaceType.Smooth
  60. SpecialMesh5.Parent = Part4
  61. SpecialMesh5.MeshId = "rbxassetid://743205322"
  62. SpecialMesh5.Scale = Vector3.new(2, 2, 2)
  63. SpecialMesh5.TextureId = "rbxassetid://743204665"
  64. SpecialMesh5.MeshType = Enum.MeshType.FileMesh
  65. Script6.Parent = Part4
  66. table.insert(cors,sandbox(Script6,function()
  67. pos = script.Parent.Position
  68. pos = Vector3.new(pos.x, pos.y-0.2, pos.z)
  69. x = 0
  70. z = 0
  71. T = -99999
  72. tall = script.Parent.Size.Y / 2
  73. math.randomseed(tick())
  74. rand = (math.random(0,20))/10
  75. while true do
  76. x = pos.x + (math.sin(T + (pos.x/5)) * math.sin(T/9))/3
  77. z = pos.z + (math.sin(T + (pos.z/6)) * math.sin(T/12))/4
  78. script.Parent.CFrame =
  79. CFrame.new(x, pos.y, z) * CFrame.Angles((z-pos.z)/tall, 0,(x-pos.x)/-tall)
  80. wait()
  81. T = T + 0.12
  82. end
  83.  
  84.  
  85. end))
  86. for i,v in pairs(mas:GetChildren()) do
  87. v.Parent = workspace
  88. pcall(function() v:MakeJoints() end)
  89. end
  90. for i,v in pairs(cors) do
  91. spawn(function()
  92. pcall(v)
  93. end)
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement