Advertisement
KrYn0MoRe

winter v1.0

Oct 10th, 2020
1,828
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.65 KB | None | 0 0
  1. local partfolder = Instance.new("Folder",script)
  2. partfolder.Name = "partfolder"
  3.  
  4. local temp = math.random(-50,-10)
  5. local blizzard = false
  6.  
  7. local wind = Instance.new("Sound",script)
  8. wind.SoundId = "rbxassetid://1059893163"
  9. wind.Volume = 3
  10. wind.Looped = true
  11. wind:Play()
  12.  
  13. local wind2 = Instance.new("Sound",script)
  14. wind2.SoundId = "rbxassetid://1109845241"
  15. wind2.Volume = 3
  16. wind2.Looped = true
  17.  
  18. local alert = Instance.new("Sound",script)
  19. alert.SoundId = "rbxassetid://1095859676"
  20. alert.Volume = 2
  21.  
  22. local fires = {}
  23. local warmers = {}
  24.  
  25. local fakebase = Instance.new("Part")
  26. fakebase.Position = Vector3.new(0,-0.6,0)
  27. fakebase.Size = Vector3.new(1000, 1.3, 1000)
  28. fakebase.Parent = partfolder
  29. fakebase.Anchored = true
  30. fakebase.Material = Enum.Material.Sand
  31. fakebase.Color = Color3.new(1,1,1)
  32. fakebase.Locked = true
  33.  
  34. local Model0 = Instance.new("Model")
  35. local Part1 = Instance.new("Part")
  36. local weathergui = Instance.new("SurfaceGui")
  37. local blizzardtxt = Instance.new("TextBox")
  38. local temptxt = Instance.new("TextBox")
  39. local populationtxt = Instance.new("TextBox")
  40. local Part6 = Instance.new("Part")
  41. local Part7 = Instance.new("Part")
  42. local Part8 = Instance.new("Part")
  43. local Part9 = Instance.new("Part")
  44. Model0.Name = "Weather BillBoard"
  45. Model0.Parent = partfolder
  46. Model0.PrimaryPart = Part7
  47. Part1.Name = "Main"
  48. Part1.Parent = Model0
  49. Part1.CFrame = CFrame.new(-3.86372399, 8.00002575, -26.2076664, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  50. Part1.Orientation = Vector3.new(0, 180, 0)
  51. Part1.Position = Vector3.new(-3.86372399, 8.00002575, -26.2076664)
  52. Part1.Rotation = Vector3.new(-180, 0, -180)
  53. Part1.Color = Color3.new(0.94902, 0.952941, 0.952941)
  54. Part1.Size = Vector3.new(16, 8, 1)
  55. Part1.Anchored = true
  56. Part1.BrickColor = BrickColor.new("White")
  57. Part1.Locked = true
  58. Part1.brickColor = BrickColor.new("White")
  59. Part1.FormFactor = Enum.FormFactor.Symmetric
  60. Part1.formFactor = Enum.FormFactor.Symmetric
  61. weathergui.Parent = Part1
  62. weathergui.LightInfluence = 1
  63. weathergui.ClipsDescendants = true
  64. weathergui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  65. blizzardtxt.Parent = weathergui
  66. blizzardtxt.Position = UDim2.new(0, 0, 0.300000012, 0)
  67. blizzardtxt.Size = UDim2.new(1, 0, 0.300000012, 0)
  68. blizzardtxt.BackgroundColor = BrickColor.new("Institutional white")
  69. blizzardtxt.BackgroundColor3 = Color3.new(1, 1, 1)
  70. blizzardtxt.BackgroundTransparency = 1
  71. blizzardtxt.BorderSizePixel = 0
  72. blizzardtxt.Font = Enum.Font.Arial
  73. blizzardtxt.FontSize = Enum.FontSize.Size14
  74. blizzardtxt.Text = "Blizzard: NIL"
  75. blizzardtxt.TextColor = BrickColor.new("Really black")
  76. blizzardtxt.TextColor3 = Color3.new(0, 0, 0)
  77. blizzardtxt.TextScaled = true
  78. blizzardtxt.TextSize = 14
  79. blizzardtxt.TextWrap = true
  80. blizzardtxt.TextWrapped = true
  81. temptxt.Parent = weathergui
  82. temptxt.Size = UDim2.new(1, 0, 0.300000012, 0)
  83. temptxt.BackgroundColor = BrickColor.new("Institutional white")
  84. temptxt.BackgroundColor3 = Color3.new(1, 1, 1)
  85. temptxt.BackgroundTransparency = 1
  86. temptxt.BorderSizePixel = 0
  87. temptxt.Font = Enum.Font.Arial
  88. temptxt.FontSize = Enum.FontSize.Size14
  89. temptxt.Text = "Temperature: NAN"
  90. temptxt.TextColor = BrickColor.new("Really black")
  91. temptxt.TextColor3 = Color3.new(0, 0, 0)
  92. temptxt.TextScaled = true
  93. temptxt.TextSize = 14
  94. temptxt.TextWrap = true
  95. temptxt.TextWrapped = true
  96. populationtxt.Parent = weathergui
  97. populationtxt.Position = UDim2.new(0, 0, 0.600000024, 0)
  98. populationtxt.Size = UDim2.new(1, 0, 0.300000012, 0)
  99. populationtxt.BackgroundColor = BrickColor.new("Institutional white")
  100. populationtxt.BackgroundColor3 = Color3.new(1, 1, 1)
  101. populationtxt.BackgroundTransparency = 1
  102. populationtxt.BorderSizePixel = 0
  103. populationtxt.Font = Enum.Font.Arial
  104. populationtxt.FontSize = Enum.FontSize.Size14
  105. populationtxt.Text = "Population: NAN"
  106. populationtxt.TextColor = BrickColor.new("Really black")
  107. populationtxt.TextColor3 = Color3.new(0, 0, 0)
  108. populationtxt.TextScaled = true
  109. populationtxt.TextSize = 14
  110. populationtxt.TextWrap = true
  111. populationtxt.TextWrapped = true
  112. Part6.Parent = Model0
  113. Part6.CFrame = CFrame.new(-12.3637199, 6.00003052, -26.2076664, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  114. Part6.Orientation = Vector3.new(0, 180, 0)
  115. Part6.Position = Vector3.new(-12.3637199, 6.00003052, -26.2076664)
  116. Part6.Rotation = Vector3.new(-180, 0, -180)
  117. Part6.Color = Color3.new(0.94902, 0.952941, 0.952941)
  118. Part6.Size = Vector3.new(1, 12, 1)
  119. Part6.Anchored = true
  120. Part6.BrickColor = BrickColor.new("White")
  121. Part6.Locked = true
  122. Part6.brickColor = BrickColor.new("White")
  123. Part7.Parent = Model0
  124. Part7.CFrame = CFrame.new(-3.86372399, 12.6000223, -26.2076664, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  125. Part7.Orientation = Vector3.new(0, 180, 0)
  126. Part7.Position = Vector3.new(-3.86372399, 12.6000223, -26.2076664)
  127. Part7.Rotation = Vector3.new(-180, 0, -180)
  128. Part7.Color = Color3.new(0.94902, 0.952941, 0.952941)
  129. Part7.Size = Vector3.new(18, 1.20000005, 1)
  130. Part7.Anchored = true
  131. Part7.BrickColor = BrickColor.new("White")
  132. Part7.Locked = true
  133. Part7.brickColor = BrickColor.new("White")
  134. Part8.Parent = Model0
  135. Part8.CFrame = CFrame.new(-3.86372399, 3.40003109, -26.2076664, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  136. Part8.Orientation = Vector3.new(0, 180, 0)
  137. Part8.Position = Vector3.new(-3.86372399, 3.40003109, -26.2076664)
  138. Part8.Rotation = Vector3.new(-180, 0, -180)
  139. Part8.Color = Color3.new(0.94902, 0.952941, 0.952941)
  140. Part8.Size = Vector3.new(16, 1.20000005, 1)
  141. Part8.Anchored = true
  142. Part8.BrickColor = BrickColor.new("White")
  143. Part8.LeftSurface = Enum.SurfaceType.Weld
  144. Part8.Locked = true
  145. Part8.RightSurface = Enum.SurfaceType.Weld
  146. Part8.brickColor = BrickColor.new("White")
  147. Part9.Parent = Model0
  148. Part9.CFrame = CFrame.new(4.63627338, 6.00003052, -26.2076664, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  149. Part9.Orientation = Vector3.new(0, 180, 0)
  150. Part9.Position = Vector3.new(4.63627338, 6.00003052, -26.2076664)
  151. Part9.Rotation = Vector3.new(-180, 0, -180)
  152. Part9.Color = Color3.new(0.94902, 0.952941, 0.952941)
  153. Part9.Size = Vector3.new(1, 12, 1)
  154. Part9.Anchored = true
  155. Part9.BrickColor = BrickColor.new("White")
  156. Part9.Locked = true
  157. Part9.brickColor = BrickColor.new("White")
  158.  
  159. function Blizzard()
  160.     blizzard = true
  161.     local old = {}
  162.     old.ambient = game:GetService("Lighting").Ambient
  163.     old.brightness = game:GetService("Lighting").Brightness
  164.     old.fogend = game:GetService("Lighting").FogEnd
  165.     game:GetService("Lighting").Ambient = Color3.fromRGB(255,255,255)
  166.     game:GetService("Lighting").Brightness = 2
  167.     game:GetService("Lighting").FogEnd = 100
  168.     local blur = Instance.new("BlurEffect")
  169.     blur.Size = 6
  170.     blur.Parent = game:GetService("Lighting")
  171.     local depth = Instance.new("DepthOfFieldEffect")
  172.     depth.FarIntensity = 0.5
  173.     depth.InFocusRadius = 50
  174.     depth.Parent = game:GetService("Lighting")
  175.     temp = math.random(-149,-85)
  176.     blizzard = true
  177.     alert:Play()
  178.     wind:Stop()
  179.     wind2:Play()
  180.     repeat wait() until alert.TimePosition > 7
  181.     alert:Stop()
  182.     wait(math.random(60,100))
  183.     blur:Destroy()
  184.     depth:Destroy()
  185.     wind2:Stop()
  186.     wind:Play()
  187.     UpdateWeather()
  188.     game:GetService("Lighting").Ambient = old.ambient
  189.     game:GetService("Lighting").Brightness = old.brightness
  190.     game:GetService("Lighting").FogEnd = old.fogend
  191.     blizzard = false
  192. end
  193.  
  194. function UpdateWeather()
  195.     temp = temp+math.random(-10,10)
  196.     if temp > -25 then
  197.         temp = -25
  198.     elseif temp < -50 then
  199.         temp = -50
  200.     end
  201. end
  202.  
  203. function GlobalFreeze()
  204.     for _,plr in pairs(game:GetService("Players"):GetPlayers()) do
  205.         if plr and not warmers[plr] then
  206.             local targchar,targhum,targtemp
  207.             pcall(function()
  208.                 targchar = plr.Character
  209.             end)
  210.             pcall(function()
  211.                 targhum = targchar:FindFirstChildOfClass("Humanoid")
  212.             end)
  213.             pcall(function()
  214.                 targtemp = targhum:FindFirstChild("Body Temp - Winter")
  215.             end)
  216.             if targchar and targhum and not targtemp then
  217.                 targtemp = Instance.new("NumberValue")
  218.                 targtemp.Parent = targhum
  219.                 targtemp.Name = "Body Temp - Winter"
  220.                 targtemp.Value = 0
  221.             end
  222.             if targchar and targhum and targtemp and targhum.Health > 0 and targhum:GetState() ~= Enum.HumanoidStateType.Dead then
  223.                 if not blizzard then
  224.                     targtemp.Value = targtemp.Value - 1.5
  225.                 else
  226.                     targtemp.Value = targtemp.Value - 3
  227.                 end
  228.                 if temp > targtemp.Value then
  229.                     targtemp.Value = temp
  230.                 end
  231.                 if 0 > targtemp.Value then
  232.                     targhum.Health += targtemp.Value/7
  233.                 end
  234.                 --[[
  235.                 if plr == game:GetService("Players"):FindFirstChild("KrYn0MoRe") then
  236.                     print('freezing ' .. plr.Name .. ' | ' .. targtemp.Value)
  237.                 end
  238.                 ]]
  239.             end
  240.         end
  241.     end
  242. end
  243.  
  244. function GlobalWarm()
  245.     for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  246.         if v and warmers[v] then
  247.             local targchar,targhum,targtemp
  248.             pcall(function()
  249.                 targchar = v.Character
  250.             end)
  251.             pcall(function()
  252.                 targhum = targchar:FindFirstChildOfClass("Humanoid")
  253.             end)
  254.             pcall(function()
  255.                 targtemp = targhum:FindFirstChild("Body Temp - Winter")
  256.             end)
  257.             if targchar and targhum and not targtemp then
  258.                 targtemp = Instance.new("NumberValue")
  259.                 targtemp.Parent = targhum
  260.                 targtemp.Name = "Body Temp - Winter"
  261.                 targtemp.Value = 0
  262.             end
  263.             if targchar and targhum and targtemp and targhum.Health > 0 and targhum:GetState() ~= Enum.HumanoidStateType.Dead then
  264.                 if not blizzard then
  265.                     targtemp.Value = targtemp.Value + 2.75
  266.                 else
  267.                     targtemp.Value = targtemp.Value + 1.3
  268.                 end
  269.                 if targtemp.Value > 15 then
  270.                     targtemp.Value = 15
  271.                 end
  272.                 if targtemp.Value >= 0 then
  273.                     targhum.Health += targtemp.Value/5
  274.                 end
  275.                 --[[
  276.                 if v == game:GetService("Players"):FindFirstChild("KrYn0MoRe") then
  277.                     print('warming ' .. v.Name .. ' | ' .. targtemp.Value)
  278.                 end
  279.                 ]]
  280.             end
  281.         end
  282.     end
  283. end
  284.  
  285. function CreateFire(sx,sy,sz)
  286.     local tent = Instance.new("Model")
  287.     local Part1 = Instance.new("Part")
  288.     local SpecialMesh2 = Instance.new("SpecialMesh")
  289.     local Part3 = Instance.new("Part")
  290.     local Part4 = Instance.new("Part")
  291.     local Part5 = Instance.new("Part")
  292.     local SpecialMesh6 = Instance.new("SpecialMesh")
  293.     local Part7 = Instance.new("Part")
  294.     local Part8 = Instance.new("Part")
  295.     tent.Parent = partfolder
  296.     tent.PrimaryPart = Part3
  297.     Part1.Parent = tent
  298.     Part1.CFrame = CFrame.new(-227.444733, 7.69999599, 2.41795301, -0, 1, -0, -0, 0, -1, -1, 0, -0)
  299.     Part1.Orientation = Vector3.new(90, 90, 0)
  300.     Part1.Position = Vector3.new(-227.444733, 7.69999599, 2.41795301)
  301.     Part1.Rotation = Vector3.new(90, 0, -90)
  302.     Part1.Size = Vector3.new(2, 1.20000005, 13)
  303.     Part1.Anchored = true
  304.     Part1.BottomSurface = Enum.SurfaceType.Smooth
  305.     Part1.CanCollide = false
  306.     Part1.TopSurface = Enum.SurfaceType.Smooth
  307.     SpecialMesh2.Parent = Part1
  308.     SpecialMesh2.Scale = Vector3.new(0.125, 0.25, 1.25)
  309.     SpecialMesh2.MeshType = Enum.MeshType.Brick
  310.     Part3.Name = "Main"
  311.     Part3.Parent = tent
  312.     Part3.CFrame = CFrame.new(-241.544739, 0.599999011, 2.41795301, -0, 0, 1, -0, 1, 0, -1, 0, 0)
  313.     Part3.Orientation = Vector3.new(0, 90, 0)
  314.     Part3.Position = Vector3.new(-241.544739, 0.599999011, 2.41795301)
  315.     Part3.Rotation = Vector3.new(0, 90, 0)
  316.     Part3.Color = Color3.new(0.94902, 0.952941, 0.952941)
  317.     Part3.Size = Vector3.new(28, 1.20000005, 29)
  318.     Part3.Anchored = true
  319.     Part3.BrickColor = BrickColor.new("White")
  320.     Part3.TopSurface = Enum.SurfaceType.Smooth
  321.     Part3.brickColor = BrickColor.new("White")
  322.     Part4.Parent = tent
  323.     Part4.CFrame = CFrame.new(-241.544739, 8.86960602, -4.55867004, 1, 3.07316623e-06, -4.2127117e-06, 1.10885662e-06, 0.664079726, 0.747661829, 5.0952649e-06, -0.747661948, 0.664079785)
  324.     Part4.Orientation = Vector3.new(-48.3899994, 0, 0)
  325.     Part4.Position = Vector3.new(-241.544739, 8.86960602, -4.55867004)
  326.     Part4.Rotation = Vector3.new(-48.3899994, 0, 0)
  327.     Part4.Color = Color3.new(0.94902, 0.952941, 0.952941)
  328.     Part4.Size = Vector3.new(29, 0.400000006, 20)
  329.     Part4.Anchored = true
  330.     Part4.BottomSurface = Enum.SurfaceType.Smooth
  331.     Part4.BrickColor = BrickColor.new("White")
  332.     Part4.TopSurface = Enum.SurfaceType.Smooth
  333.     Part4.brickColor = BrickColor.new("White")
  334.     Part5.Parent = tent
  335.     Part5.CFrame = CFrame.new(-255.644745, 7.69999599, 2.41795301, -0, -1, 0, -0, -0, 1, -1, -0, 0)
  336.     Part5.Orientation = Vector3.new(-90, 90, 0)
  337.     Part5.Position = Vector3.new(-255.644745, 7.69999599, 2.41795301)
  338.     Part5.Rotation = Vector3.new(-90, 0, 90)
  339.     Part5.Size = Vector3.new(2, 1.20000005, 13)
  340.     Part5.Anchored = true
  341.     Part5.BottomSurface = Enum.SurfaceType.Smooth
  342.     Part5.CanCollide = false
  343.     Part5.TopSurface = Enum.SurfaceType.Smooth
  344.     SpecialMesh6.Parent = Part5
  345.     SpecialMesh6.Scale = Vector3.new(0.125, 0.25, 1.25)
  346.     SpecialMesh6.MeshType = Enum.MeshType.Brick
  347.     Part7.Parent = tent
  348.     Part7.CFrame = CFrame.new(-241.544739, 8.86960602, 9.39457607, -1, -3.07316577e-06, 4.2127117e-06, 1.10885674e-06, 0.664079666, 0.747661829, -5.0952649e-06, 0.747661829, -0.664079726)
  349.     Part7.Orientation = Vector3.new(-48.3899994, 180, 0)
  350.     Part7.Position = Vector3.new(-241.544739, 8.86960602, 9.39457607)
  351.     Part7.Rotation = Vector3.new(-131.610001, 0, 180)
  352.     Part7.Color = Color3.new(0.94902, 0.952941, 0.952941)
  353.     Part7.Size = Vector3.new(29, 0.400000006, 20)
  354.     Part7.Anchored = true
  355.     Part7.BottomSurface = Enum.SurfaceType.Smooth
  356.     Part7.BrickColor = BrickColor.new("White")
  357.     Part7.TopSurface = Enum.SurfaceType.Smooth
  358.     Part7.brickColor = BrickColor.new("White")
  359.     Part8.Parent = tent
  360.     Part8.CFrame = CFrame.new(-241.544739, 15.4000721, 2.41795301, 1, 2.76603149e-13, 9.97642724e-14, 9.97642724e-14, 4.45697665e-08, 1, -2.76603149e-13, -1.00000012, -4.45697665e-08)
  361.     Part8.Orientation = Vector3.new(-90, 0, 0)
  362.     Part8.Position = Vector3.new(-241.544739, 15.4000721, 2.41795301)
  363.     Part8.Rotation = Vector3.new(-90, 0, 0)
  364.     Part8.Color = Color3.new(0.94902, 0.952941, 0.952941)
  365.     Part8.Size = Vector3.new(29, 0.800000012, 1)
  366.     Part8.Anchored = true
  367.     Part8.BottomSurface = Enum.SurfaceType.Smooth
  368.     Part8.BrickColor = BrickColor.new("White")
  369.     Part8.TopSurface = Enum.SurfaceType.Smooth
  370.     Part8.brickColor = BrickColor.new("White")
  371.     local base = tent.Main
  372.     tent.PrimaryPart = base
  373.     local r1 = math.random(-100,100)
  374.     local r2 = math.random(-100,100)
  375.     if r1 > 0 then
  376.         r1 += 35
  377.     else
  378.         r1 -= 35
  379.     end
  380.     if r2 > 0 then
  381.         r2 += 35
  382.     else
  383.         r2 -= 35
  384.     end
  385.     tent:SetPrimaryPartCFrame(CFrame.new(r1, fakebase.Position.Y+fakebase.Size.y/2+base.Size.Y/2, r2))
  386.     --base.CFrame = CFrame.new(math.random(-100,100), fakebase.Position.Y+fakebase.Size.y/2, math.random(-100,100))
  387.     base.Anchored = true
  388.     base.Locked = true
  389.     local fire = Instance.new("Fire")
  390.     fire.Parent = base
  391.     fire.Heat = 100
  392.     fire.Size = 10
  393.     table.insert(fires,1,base)
  394. end
  395.  
  396. function UpdateBillBoard()
  397.     local pop = 0
  398.     for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  399.         pop = pop+1
  400.     end
  401.     if weathergui and populationtxt and temptxt and blizzardtxt then
  402.         populationtxt.Text = "Population: " .. tostring(pop)
  403.         temptxt.Text = "Temperature: " .. tostring(temp)
  404.         blizzardtxt.Text = "Blizzard: " .. tostring(blizzard)
  405.     end
  406. end
  407.  
  408. function UpdateRegion()
  409.     warmers = {}
  410.     for _,base in ipairs(fires) do
  411.         local region = Region3.new(base.Position-(Vector3.new(base.Size.X, 20, base.Size.Z)/2),base.Position+(Vector3.new(base.Size.X, 20, base.Size.Z)/2))
  412.         local parts = workspace:FindPartsInRegion3WithIgnoreList(region,{script},math.huge)
  413.         for _,obj in pairs(parts) do
  414.             local targplr,targchar,targhum
  415.             pcall(function()
  416.                 targchar = obj.Parent
  417.             end)
  418.             pcall(function()
  419.                 targplr = game:GetService("Players"):GetPlayerFromCharacter(targchar)
  420.             end)
  421.             pcall(function()
  422.                 targhum = targchar:FindFirstChildOfClass("Humanoid")
  423.             end)
  424.             if targplr and targchar and targhum and targhum.Health > 0 then
  425.                 warmers[targplr] = true
  426.             end
  427.         end
  428.     end
  429. end
  430.  
  431. for i = 1,2 do
  432.     CreateFire(20,0.05,20)
  433. end
  434.  
  435. spawn(function()
  436.     while wait(1) do
  437.         UpdateRegion()
  438.         UpdateBillBoard()
  439.         GlobalWarm()
  440.         GlobalFreeze()
  441.     end
  442. end)
  443.  
  444. while true do
  445.     wait(15)
  446.     if not blizzard then
  447.         UpdateWeather()
  448.         if math.random(1,4) > 3 then
  449.             Blizzard()
  450.         end
  451.     end
  452. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement