Advertisement
jombo091

Cloud Script (ROBLOX)

Nov 16th, 2019
595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. --Made by jombo091 cloud script (not an exploit)
  2.  
  3.  
  4. amount=16
  5. speeds={30,61}
  6. limits={
  7. Vector3.new(-3000,300,-3000),
  8. Vector3.new(3000,400,3000)
  9. }
  10. cloudname="Cloud" --put a cloud that you want it to clone into lighting and enter it's name here, or this script will generate one for you.
  11. cloudsgroupname="Clouds"
  12. releasecooldown=5
  13. rotatedclouds=true --If you want the clouds all facing the same direction, set this to false. True will randomly rotate them.
  14.  
  15.  
  16.  
  17.  
  18.  
  19. rate=1/30
  20. lastrelease=0
  21. debris=game:GetService("Debris")
  22.  
  23. local clouds=script.Parent:FindFirstChild(cloudsgroupname) or Instance.new("Model",script.Parent)
  24. clouds.Name=cloudsgroupname
  25.  
  26.  
  27.  
  28. function generatecloud()
  29. local p=Instance.new("Part")
  30. p.Name=cloudname
  31. p.formFactor="Custom"
  32. p.Size=Vector3.new(0,0,0)
  33. p.TopSurface="Smooth"
  34. p.BottomSurface="Smooth"
  35. p.Anchored=true
  36. p.CanCollide=false
  37. local m=Instance.new("SpecialMesh")
  38. m.MeshId="http://www.roblox.com/asset/?id=111820358"
  39. m.TextureId="http://www.roblox.com/asset/?id=111820961"
  40. m.Scale=Vector3.new(1000,500,1000)
  41. m.Parent=p
  42. return p
  43. end
  44. function createcloud(pos)
  45. local clonecloud=game.Lighting:FindFirstChild(cloudname)
  46. local newcloud=(clonecloud and clonecloud:clone()) or generatecloud()
  47. newcloud.CFrame=CFrame.new(pos)
  48. if rotatedclouds then
  49. newcloud.CFrame=newcloud.CFrame*CFrame.Angles(0,math.pi*2*math.random(),0)
  50. end
  51. newcloud.Name="CloudSpeed"..tostring(math.random(speeds[1],speeds[2]))
  52. debris:AddItem(newcloud,7*60)
  53. newcloud.Transparency=1
  54. newcloud.Parent=clouds
  55. end
  56.  
  57.  
  58. local gc=clouds:GetChildren() --creates initial population
  59. local missing=amount-#gc
  60. if missing>0 then
  61. for i=1,missing do
  62. createcloud(Vector3.new(math.random(limits[1].x,limits[2].x),math.random(limits[1].y,limits[2].y),math.random(limits[1].z,limits[2].z)))
  63. end
  64. end
  65.  
  66.  
  67. while true do
  68. local t1,t2=wait(rate)
  69. local gc=clouds:GetChildren()
  70. if #gc<amount and lastrelease<t2 then
  71. lastrelease=t2+releasecooldown
  72. createcloud(Vector3.new(math.random(limits[1].x,limits[2].x),math.random(limits[1].y,limits[2].y),limits[2].z))
  73. end
  74. for i,v in pairs(gc) do
  75. local speed=string.sub(v.Name,11)
  76. v.CFrame=v.CFrame+Vector3.new(0,0,-speed*rate)
  77. if v.Position.z<limits[1].z then
  78. v.Transparency=v.Transparency+(rate/3)
  79. if v.Transparency>1 then
  80. v:remove()
  81. end
  82. elseif v.Transparency>0 then
  83. v.Transparency=v.Transparency-(rate/3)
  84. if v.Transparency<0 then
  85. v.Transparency=0
  86. end
  87. end
  88. end
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement