DynamicWeather v1

This is my dynamic weather script I was selling, but you can get it for FREE from this link
mail@pastecode.io avatar
unknown
lua
3 years ago
7.7 kB
5
Indexable
Never
--
-- thank you for purchasing Dynamic Weather by C0MMAND4NT
-- please do not steal
-- if you do not know how to program, do not edit anything below
-- update: v1.0
--
--
e=true
g="N/A"
i=Instance.new("Model")
i.Parent=nil i.Name="CollectedGroundSnow"
j=game.Workspace:getChildren()
_=i:getChildren() 
--return children
for _=1,#j do if j[_].className=="Part"then
o=Instance.new("Part") o.formFactor=("Custom")
o.Size=Vector3.new(j[_].Size.X,.6,j[_].Size.Z)
o.CFrame=j[_].CFrame+Vector3.new(0,j[_].Size.Y/2+.3,0
) o.Anchored=true o.CanCollide=false o.BrickColor=BrickColor.new("White"
) f=Instance.new("BlockMesh",o) f.Scale=Vector3.new(.999,.999,.999) o.Parent=i
end if j[_].className=="Model"and game.Players:findFirstChild(j[_].Name)==nil 
then n=j[_]:getChildren() if#n~=0 then for _=1,#n 
do if n[_].className=="Part"then o=Instance.new("Part")
o.formFactor=("Custom") o.Size=Vector3.new(n[_].Size.X,.6,n[_].Size.Z) 
o.CFrame=n[_].CFrame+Vector3.new(0,n[_].Size.Y/2+.3,0) o.Anchored=true 
o.CanCollide=false o.BrickColor=BrickColor.new("White")
f=Instance.new("BlockMesh",o) f.Scale=Vector3.new(.999,.999,.999)
o.Parent=i end if n[_].className=="Model"and game.Players:findFirstChild(n[_].Name)==nil 
then h=n[_]:getChildren() if#n~=0 
then for _=1,#h do if h[_].className=="Part"then o=Instance.new("Part")
o.formFactor=("Custom")
o.Size=Vector3.new(h[_].Size.X,.6,h[_].Size.Z)
o.CFrame=h[_].CFrame+Vector3.new(0,h[_].Size.Y/2+.3,0) 
o.Anchored=true o.CanCollide=false o.BrickColor=BrickColor.new("White")
f=Instance.new("BlockMesh",o) f.Scale=Vector3.new(.999,.999,.999) o.Parent=i 
end end end end end end end end 
function a(_)if _.Character==nil or g~="Cold"or e==false 
then return end e=false m=Instance.new("Part")
m.Name="SmokePart" m.CanCollide=false m.Transparency=1
d=Instance.new("Smoke",m)
d.Size=.1 d.Opacity=.05 d.RiseVelocity=2 m.CFrame=_.Character.Head.CFrame 
m.CFrame=m.CFrame*CFrame.Angles(0,math.pi/2,0) m.Parent=game.Workspace m.Anchored=true wait(1) 
m:remove() e=true 
end game.Players.ChildAdded:connect(function(b)b.Chatted:connect(function(_)a(b)end)end) 
function o(_,a)for _=1,_ do l=Instance.new("Part") l.Name="Snow" l.Anchored=false 
l.CanCollide=false l.Material=("Ice") l.BrickColor=BrickColor.new("White")
l.Position=Vector3.new(math.random(-500,500),500,math.random(-500,500))
l.Shape=("Ball") l.Size=Vector3.new(1,1,1) l.Parent=game.Workspace game.Debris:AddItem(l) 
wait(a)end
end function c()game.Lighting.Brightness=100 script.Lightning:Play() wait(math.random(.1,.01)) 
script.Thunder:Play() game.Lighting.Brightness=math.pi/7 end function b(_,b,a)for _=1,_ 
do k=Instance.new("Part") k.Name="Rain" k.Anchored=false k.CanCollide=false 
k.Transparency=math.pi/10 k.BrickColor=BrickColor.new("Bright blue"
) k.Position=Vector3.new(math.random(-500,500),500,math.random(-500,500)) 
k.Shape=("Ball") k.Size=Vector3.new(1,1,1) k.Parent=game.Workspace game.Debris:AddItem(k) wait(b) 
if math.random(1,125)==7 and a==true then c()end end end 
while true 
do g="Cold" game.Lighting.Brightness=math.pi/10 i.Parent=script o(5000,.01) i.Parent=nil g="Warm" 
game.Lighting.Brightness=math.pi/9 wait(20) b(2500,.01,false) wait(10) g="Hot" 
game.Lighting.Brightness=math.pi/7 wait(50) b(1500,.01,true) wait(25) 
g="Moderate" game.Lighting.Brightness=math.pi/8 wait(10) o(2000,.1) wait(50)end
--[[
game.Workspace:WaitForChild("Weather")
e=game.Workspace.Weather
c=game.Players.LocalPlayer
c.Character:WaitForChild("Torso")
math.randomseed(tick()) 
function _()wait()
local a=e.CurrentWeather.Value
if e.CurrentWeather.Value=="Drizzle"
or e.CurrentWeather.Value=="Showers"
or e.CurrentWeather.Value=="Rain"
or e.CurrentWeather.Value=="Heavy Rain"
or e.CurrentWeather.Value=="Thunderstorms"
or e.CurrentWeather.Value=="Strong Thunderstorms"
then if e.CurrentWeather.Value=="Drizzle"
then d=1 elseif e.CurrentWeather.Value=="Showers"
then d=2 elseif e.CurrentWeather.Value=="Rain"
or e.CurrentWeather.Value=="Thunderstorms"then
d=3 elseif e.CurrentWeather.Value=="Strong Thunderstorms"
or e.CurrentWeather.Value=="Heavy Rain"
then d=4 end local _=5-d script.Rain.Volume=1/_ script.Rain:Play() 
repeat wait() for _=1,d*2 
do if c.Character 
then local _=c.Character.Torso 
local a=Instance.new("Part")
a.Parent=e.Parts
a.Name="Rain"
a.Anchored=false
a.CanCollide=false
a.FormFactor="Custom" a.Size=Vector3.new(.2,1,.2)
a.Position=Vector3.new(math.random(_.Position.X-100,_.Position.X+100),_.Position.Y+100,math.random(_.Position.Z-100,_.Position.Z+100)) 
a.BrickColor=BrickColor.new(135) 
a.Touched:connect(function()a:remove()end)
end end until e.CurrentWeather.Value~=a script.Rain:Pause()
elseif e.CurrentWeather.Value=="Flurries"or e.CurrentWeather.Value=="Snow Showers"
or e.CurrentWeather.Value=="Snow"or e.CurrentWeather.Value=="Heavy Snow"
then if e.CurrentWeather.Value=="Flurries"then d=1 
elseif e.CurrentWeather.Value=="Snow Showers"
then d=2 elseif e.CurrentWeather.Value=="Snow"
then d=3 elseif e.CurrentWeather.Value=="Heavy Snow"
then d=4 end repeat wait() for _=1,d*2 do if c.Character 
then local _=c.Character.Torso 
local a=Instance.new("Part") 
a.Parent=e.Parts a.Name="Snow" 
a.Anchored=false a.CanCollide=false a.FormFactor="Custom" 
a.Size=Vector3.new(.2,.2,.2) 
a.Position=Vector3.new(math.random(_.Position.X-100,_.Position.X+100),_.Position.Y+100,math.random(_.Position.Z-100,_.Position.Z+100)) 
a.BrickColor=BrickColor.new(1) a.Touched:connect(function()a:remove()end)
end end until e.CurrentWeather.Value~=a 
elseif e.CurrentWeather.Value=="Freezing Drizzle"
or e.CurrentWeather.Value=="Rain / Snow Showers"
or e.CurrentWeather.Value=="Rain / Snow"
or e.CurrentWeather.Value=="Heavy Rain / Snow"
then if e.CurrentWeather.Value=="Freezing Drizzle"
then d=1 elseif e.CurrentWeather.Value=="Rain / Snow Showers"
then d=2 elseif e.CurrentWeather.Value=="Rain / Snow"
then d=3 elseif e.CurrentWeather.Value=="Heavy Rain / Snow"
then d=4 end local _=5-d script.Rain.Volume=1/_ script.Rain:Play() 
if e.CurrentTemp.Value==31 then b=1 
elseif e.CurrentTemp.Value==32 then b=2 
elseif e.CurrentTemp.Value==33 
then b=3 
end repeat wait() 
for _=1,d*2 do if c.Character 
then local _=math.random(1,4) if _>b 
then local _=c.Character.Torso 
local a=Instance.new("Part") 
a.Parent=e.Parts a.Name="Snow" 
a.Anchored=false a.CanCollide=false 
a.FormFactor="Custom" a.Size=Vector3.new(.2,.2,.2) 
a.Position=Vector3.new(math.random(_.Position.X-100,_.Position.X+100),_.Position.Y+100,math.random(_.Position.Z-100,_.Position.Z+100)) 
a.BrickColor=BrickColor.new(1) a.Touched:connect(function()a:remove()end)
else local _=c.Character.Torso 
local a=Instance.new("Part") a.Parent=e.Parts 
a.Name="Rain" a.Anchored=false a.CanCollide=false a.FormFactor="Custom" 
a.Size=Vector3.new(.2,1,.2) 
a.Position=Vector3.new(math.random(_.Position.X-25,_.Position.X+25),_.Position.Y+100,math.random(_.Position.Z-25,_.Position.Z+25)) 
a.BrickColor=BrickColor.new(135) a.Touched:connect(function()a:remove()end)
end end end until e.CurrentWeather.Value~=a script.Rain:Pause()
end end _() 
e.CurrentWeather.Changed:connect(_) game.Workspace.ChildAdded:connect(function(_)if _.Name=="Lightning"
then if(c.Character.Torso.Position-_.LightningPart.Position).magnitude<1000 then a=167060276 
elseif(c.Character.Torso.Position-_.LightningPart.Position).magnitude<2000 then a=167060296 
else local _=math.random(1,2) if _==1 then a=167060342 else a=167060366 end end 
local _=Instance.new("Sound") _.Parent=c _.SoundId="rbxassetid://"..a _:Play() wait(20) _:remove()
end end)
]]
--