Advertisement
Hermaxs

Cloud Visualizer

Jan 16th, 2019
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.00 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
  6.  
  7.  
  8. -- Made by Zuu_Roku w/ Help from Cass!
  9. -- Venge is ok happy? But nebby is better /e dab
  10.  
  11. print("Made by Zuu_Roku, Thanks Cass for Cloud CLerp.")
  12.  
  13. print("Rain Cloud Visualizer (Update 1.2 I guess) Commands:")
  14.  
  15. print("!play (ID) [Changes song]")
  16.  
  17. print("!pitch (#) [normal pitch is '10'][THIS IS FIXED AAAAAAAAAAAAAAAAAA, Sound.Pitch was Depreciated and never knew, hence why it never worked]")
  18.  
  19. print("!snow / !rain [Changes Weather]")
  20.  
  21. print("!rate (#) [Changes amount of particles]")
  22.  
  23. print("Click for a Lightning bolt!")
  24.  
  25.  
  26.  
  27. local Player = game.Players.LocalPlayer
  28.  
  29. local Character = Player.Character
  30.  
  31. local maus = Player:GetMouse()
  32.  
  33. local H = Character["Head"]
  34.  
  35. local multiplier = 4
  36.  
  37. local ltdb = false
  38.  
  39. local Cloud = Instance.new('Part',Character)
  40.  
  41. Cloud.Size = Vector3.new(1,1,1)
  42.  
  43. Cloud.Anchored = true
  44.  
  45. Cloud.CanCollide = false
  46.  
  47. Cloud.Transparency = 0
  48.  
  49.  
  50.  
  51. local CloudMesh = Instance.new('SpecialMesh',Cloud)
  52.  
  53. CloudMesh.Scale = Vector3.new(5,1,5)
  54.  
  55. CloudMesh.MeshId = "http://www.roblox.com/asset/?id=1095708"
  56.  
  57. CloudMesh.Offset = Vector3.new(0,1,0)
  58.  
  59.  
  60. local loudness = 0
  61.  
  62.  
  63.  
  64. local S = Instance.new('Sound',Cloud)
  65.  
  66. S.SoundId = "rbxassetid://170020261"
  67.  
  68. S.Looped = true
  69.  
  70. S.Volume = 8
  71.  
  72. S.PlaybackSpeed = 1
  73.  
  74. S.MaxDistance = 100
  75.  
  76. S:Play()
  77.  
  78.  
  79. local Volume = 5
  80.  
  81.  
  82.  
  83. local Rain = Instance.new('ParticleEmitter',Cloud)
  84.  
  85. Rain.Color = ColorSequence.new(Color3.new(1,1,1),Color3.fromRGB(175,255,255))
  86.  
  87. Rain.Size = NumberSequence.new(.5)
  88.  
  89. Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
  90.  
  91. Rain.Transparency = NumberSequence.new(0,.6)
  92.  
  93. Rain.Acceleration = Vector3.new(0,-150,0)
  94.  
  95. Rain.Lifetime = NumberRange.new(5,10)
  96.  
  97. Rain.Rate = 100
  98.  
  99.  
  100.  
  101. local Shade = Instance.new('PointLight',Cloud)
  102.  
  103. Shade.Range = 10
  104.  
  105. Shade.Color = Color3.fromRGB(50,50,50)
  106.  
  107. Shade.Enabled = true
  108.  
  109. Shade.Shadows = true
  110.  
  111.  
  112.  
  113. local rad = math.rad
  114.  
  115. local sin = math.sin
  116.  
  117. local tan = math.tan
  118.  
  119. local cos = math.cos
  120.  
  121. Player.Chatted:connect(function(m)
  122.  
  123. if m:match("!play%s%d+") then
  124.  
  125. S:Stop()
  126.  
  127. S.SoundId = "rbxassetid://"..m:match("!play%s(%d+)")
  128.  
  129. S:Play()
  130.  
  131. elseif m:match("!volume%s%d+") then
  132.  
  133. S.Volume = m:match("!volume%s(%d+)")
  134.  
  135. Volume = m:match("!volume%s(%d+)")
  136.  
  137. elseif m:match("!pitch%s%d+") then
  138.  
  139. S.PlaybackSpeed = m:match("!pitch%s(%d+)")/10
  140.  
  141. elseif m:match("!snow") then
  142.  
  143. Rain.Texture = "http://www.roblox.com/asset/?id=605668174"
  144.  
  145. Rain.Acceleration = Vector3.new(0,-10,0)
  146.  
  147. Rain.Lifetime = NumberRange.new(15,20)
  148.  
  149. Rain.Size = NumberSequence.new(.2)
  150.  
  151. elseif m:match("!rain") then
  152.  
  153. Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
  154.  
  155. Rain.Acceleration = Vector3.new(0,-150,0)
  156.  
  157. Rain.Lifetime = NumberRange.new(5,10)
  158.  
  159. Rain.Size = NumberSequence.new(.5)
  160.  
  161. elseif m:match("!rate%s%d+") then
  162.  
  163. multiplier = m:match("!rate%s(%d+)")
  164.  
  165. elseif m:match("!rr") then
  166.  
  167. print(Rain.Rate)
  168.  
  169. elseif m:match("!pbs") then
  170.  
  171. print(S.PlaybackSpeed)
  172.  
  173. elseif m:match("!rot") then
  174.  
  175. print(Cloud.Rotation)
  176.  
  177. end
  178. end)
  179.  
  180.  
  181.  
  182. function Weld(x,y)
  183.  
  184. local w = Instance.new("Weld")
  185.  
  186. w.Part0 = x
  187.  
  188. w.Part1 = y
  189.  
  190. w.Name = tostring(y.Name).."_Weld"
  191.  
  192. w.Parent = x
  193.  
  194. return w
  195.  
  196. end
  197.  
  198.  
  199.  
  200. function Clerp(start,destination,increment)
  201.  
  202. local function slerp(a,b,c)return (1-c)*a+(c*b)end
  203.  
  204. local c1 = {start.X,start.Y,start.Z,start:toEulerAnglesXYZ()}
  205.  
  206. local c2 = {destination.X,destination.Y,destination.Z,destination:toEulerAnglesXYZ()}
  207.  
  208. for i,v in pairs(c1)do c1[i] = slerp(v,c2[i],increment)end
  209.  
  210. return CFrame.new(c1[1],c1[2],c1[3])*CFrame.Angles(c1[4],c1[5],c1[6])
  211.  
  212. end
  213.  
  214.  
  215.  
  216. DrawLightning = function(Start,End,Times,Offset,Color,Thickness)
  217.  
  218. if Start.y>End.y then
  219.  
  220. local magz = (Start - End).magnitude
  221.  
  222. local curpos = Start
  223.  
  224. local trz = {-Offset,Offset}
  225.  
  226. for i=1,Times do
  227.  
  228. local li = Instance.new("Part",workspace)
  229.  
  230. li.TopSurface =10
  231.  
  232. li.BottomSurface = 10
  233.  
  234. li.Anchored = true
  235.  
  236. li.Transparency = 0
  237.  
  238. li.BrickColor = Color
  239.  
  240. li.formFactor = "Custom"
  241.  
  242. li.CanCollide = false
  243.  
  244. li.Size = Vector3.new(Thickness,Thickness,magz/Times)
  245.  
  246. local lt=Instance.new("SpotLight",li)
  247.  
  248. lt.Range=16
  249.  
  250. lt.Brightness=5
  251.  
  252. lt.Shadows=true
  253.  
  254. lt.Angle=45
  255.  
  256. lt.Face="Top"
  257.  
  258. lt.Color=li.BrickColor.Color
  259.  
  260. local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  261.  
  262. local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
  263.  
  264. if Times == i then
  265.  
  266. local magz2 = (curpos - End).magnitude
  267.  
  268. li.Size = Vector3.new(Thickness,Thickness,magz2)
  269.  
  270. li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
  271.  
  272. else
  273.  
  274. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  275.  
  276. end
  277.  
  278. curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p Spawn(function() for i=1,5 do wait() li.Transparency = li.Transparency+.2 end li:Destroy() end)
  279.  
  280. end
  281.  
  282. for i,x in pairs(workspace:GetChildren()) do if x:IsA'Model' and x:findFirstChild('Head') and x~=Character and x.Name~="Zuu_Roku" then
  283.  
  284. for a,v in pairs(x:GetChildren()) do if v:IsA'Humanoid' then if (x.Head.CFrame.p-End).magnitude<10 then x:BreakJoints() end end end end end
  285.  
  286. end
  287.  
  288. end
  289.  
  290.  
  291.  
  292. maus.Button1Down:connect(function()
  293.  
  294. if ltdb==false then
  295.  
  296. ltdb=true
  297.  
  298. DrawLightning(Cloud.CFrame.p,maus.Hit.p,5,.5,BrickColor.new("New Yeller"),.2)
  299.  
  300. wait()
  301.  
  302. ltdb=false
  303.  
  304. end
  305.  
  306. end)
  307.  
  308. local Spinny = 0
  309.  
  310. local NoU = 0
  311.  
  312. while true do
  313.  
  314. Rain.Rate = (S.PlaybackLoudness + 1) * multiplier/5
  315.  
  316. game:GetService('RunService').RenderStepped:wait()
  317.  
  318. local HP = H.CFrame.p
  319.  
  320. local sizer = S.PlaybackLoudness/55 + 5
  321.  
  322. Cloud.Size = Vector3.new(sizer,1,sizer)
  323.  
  324. Shade.Range = sizer
  325.  
  326. CloudMesh.Scale = Vector3.new(sizer,5,sizer)
  327.  
  328. Cloud.CFrame = Clerp(Cloud.CFrame, CFrame.new(HP + Vector3.new(0,4,0))*CFrame.Angles(0,rad(90),0), .1)
  329.  
  330. Cloud.BrickColor = BrickColor.new(Color3.fromRGB(255 - S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2))
  331. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement