Advertisement
WagnerJunio07

Cloud

Dec 14th, 2018
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.74 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. -- Made by Zuu_Roku w/ Help from Cass!
  88. -- Venge is ok happy? But nebby is better /e dab
  89.  
  90. print("Made by Zuu_Roku, Thanks Cass for Cloud CLerp.")
  91.  
  92. print("Rain Cloud Visualizer (Update 1.2 I guess) Commands:")
  93.  
  94. print("!play (ID) [Changes song]")
  95.  
  96. print("!pitch (#) [normal pitch is '10'][THIS IS FIXED AAAAAAAAAAAAAAAAAA, Sound.Pitch was Depreciated and never knew, hence why it never worked]")
  97.  
  98. print("!snow / !rain [Changes Weather]")
  99.  
  100. print("!rate (#) [Changes amount of particles]")
  101.  
  102. print("Click for a Lightning bolt!")
  103.  
  104.  
  105.  
  106. local Player = owner
  107.  
  108. local Character = Player.Character
  109.  
  110. local H = Character["Head"]
  111.  
  112. local multiplier = 4
  113.  
  114. local ltdb = false
  115.  
  116. local Cloud = Instance.new('Part',Character)
  117.  
  118. Cloud.Size = Vector3.new(1,1,1)
  119.  
  120. Cloud.Anchored = true
  121.  
  122. Cloud.CanCollide = false
  123.  
  124. Cloud.Transparency = 0
  125.  
  126.  
  127.  
  128. local CloudMesh = Instance.new('SpecialMesh',Cloud)
  129.  
  130. CloudMesh.Scale = Vector3.new(5,1,5)
  131.  
  132. CloudMesh.MeshId = "http://www.roblox.com/asset/?id=1095708"
  133.  
  134. CloudMesh.Offset = Vector3.new(0,1,0)
  135.  
  136.  
  137. local loudness = 0
  138.  
  139.  
  140.  
  141. local S = Instance.new('Sound',Cloud)
  142.  
  143. S.SoundId = "rbxassetid://170020261"
  144.  
  145. S.Looped = true
  146.  
  147. S.Volume = 8
  148.  
  149. S.PlaybackSpeed = 1
  150.  
  151. S.MaxDistance = 100
  152.  
  153. S:Play()
  154.  
  155.  
  156. local Volume = 5
  157.  
  158.  
  159.  
  160. local Rain = Instance.new('ParticleEmitter',Cloud)
  161.  
  162. Rain.Color = ColorSequence.new(Color3.new(1,1,1),Color3.fromRGB(175,255,255))
  163.  
  164. Rain.Size = NumberSequence.new(.5)
  165.  
  166. Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
  167.  
  168. Rain.Transparency = NumberSequence.new(0,.6)
  169.  
  170. Rain.Acceleration = Vector3.new(0,-150,0)
  171.  
  172. Rain.Lifetime = NumberRange.new(5,10)
  173.  
  174. Rain.Rate = 100
  175.  
  176.  
  177.  
  178. local Shade = Instance.new('PointLight',Cloud)
  179.  
  180. Shade.Range = 10
  181.  
  182. Shade.Color = Color3.fromRGB(50,50,50)
  183.  
  184. Shade.Enabled = true
  185.  
  186. Shade.Shadows = true
  187.  
  188.  
  189.  
  190. local rad = math.rad
  191.  
  192. local sin = math.sin
  193.  
  194. local tan = math.tan
  195.  
  196. local cos = math.cos
  197.  
  198. Player.Chatted:connect(function(m)
  199.  
  200. if m:match("!play%s%d+") then
  201.  
  202. S:Stop()
  203.  
  204. S.SoundId = "rbxassetid://"..m:match("!play%s(%d+)")
  205.  
  206. S:Play()
  207.  
  208. elseif m:match("!volume%s%d+") then
  209.  
  210. S.Volume = m:match("!volume%s(%d+)")
  211.  
  212. Volume = m:match("!volume%s(%d+)")
  213.  
  214. elseif m:match("!pitch%s%d+") then
  215.  
  216. S.PlaybackSpeed = m:match("!pitch%s(%d+)")/10
  217.  
  218. elseif m:match("!snow") then
  219.  
  220. Rain.Texture = "http://www.roblox.com/asset/?id=605668174"
  221.  
  222. Rain.Acceleration = Vector3.new(0,-10,0)
  223.  
  224. Rain.Lifetime = NumberRange.new(15,20)
  225.  
  226. Rain.Size = NumberSequence.new(.2)
  227.  
  228. elseif m:match("!rain") then
  229.  
  230. Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
  231.  
  232. Rain.Acceleration = Vector3.new(0,-150,0)
  233.  
  234. Rain.Lifetime = NumberRange.new(5,10)
  235.  
  236. Rain.Size = NumberSequence.new(.5)
  237.  
  238. elseif m:match("!rate%s%d+") then
  239.  
  240. multiplier = m:match("!rate%s(%d+)")
  241.  
  242. elseif m:match("!rr") then
  243.  
  244. print(Rain.Rate)
  245.  
  246. elseif m:match("!pbs") then
  247.  
  248. print(S.PlaybackSpeed)
  249.  
  250. elseif m:match("!rot") then
  251.  
  252. print(Cloud.Rotation)
  253.  
  254. end
  255. end)
  256.  
  257.  
  258.  
  259. function Weld(x,y)
  260.  
  261. local w = Instance.new("Weld")
  262.  
  263. w.Part0 = x
  264.  
  265. w.Part1 = y
  266.  
  267. w.Name = tostring(y.Name).."_Weld"
  268.  
  269. w.Parent = x
  270.  
  271. return w
  272.  
  273. end
  274.  
  275.  
  276.  
  277. function Clerp(start,destination,increment)
  278.  
  279. local function slerp(a,b,c)return (1-c)*a+(c*b)end
  280.  
  281. local c1 = {start.X,start.Y,start.Z,start:toEulerAnglesXYZ()}
  282.  
  283. local c2 = {destination.X,destination.Y,destination.Z,destination:toEulerAnglesXYZ()}
  284.  
  285. for i,v in pairs(c1)do c1[i] = slerp(v,c2[i],increment)end
  286.  
  287. return CFrame.new(c1[1],c1[2],c1[3])*CFrame.Angles(c1[4],c1[5],c1[6])
  288.  
  289. end
  290.  
  291.  
  292.  
  293. DrawLightning = function(Start,End,Times,Offset,Color,Thickness)
  294.  
  295. if Start.y>End.y then
  296.  
  297. local magz = (Start - End).magnitude
  298.  
  299. local curpos = Start
  300.  
  301. local trz = {-Offset,Offset}
  302.  
  303. for i=1,Times do
  304.  
  305. local li = Instance.new("Part",workspace)
  306.  
  307. li.TopSurface =10
  308.  
  309. li.BottomSurface = 10
  310.  
  311. li.Anchored = true
  312.  
  313. li.Transparency = 0
  314.  
  315. li.BrickColor = Color
  316.  
  317. li.formFactor = "Custom"
  318.  
  319. li.CanCollide = false
  320.  
  321. li.Size = Vector3.new(Thickness,Thickness,magz/Times)
  322.  
  323. local lt=Instance.new("SpotLight",li)
  324.  
  325. lt.Range=16
  326.  
  327. lt.Brightness=5
  328.  
  329. lt.Shadows=true
  330.  
  331. lt.Angle=45
  332.  
  333. lt.Face="Top"
  334.  
  335. lt.Color=li.BrickColor.Color
  336.  
  337. local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  338.  
  339. local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
  340.  
  341. if Times == i then
  342.  
  343. local magz2 = (curpos - End).magnitude
  344.  
  345. li.Size = Vector3.new(Thickness,Thickness,magz2)
  346.  
  347. li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
  348.  
  349. else
  350.  
  351. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  352.  
  353. end
  354.  
  355. 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)
  356.  
  357. end
  358.  
  359. 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
  360.  
  361. 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
  362.  
  363. end
  364.  
  365. end
  366.  
  367.  
  368.  
  369. maus.Button1Down:connect(function()
  370.  
  371. if ltdb==false then
  372.  
  373. ltdb=true
  374.  
  375. DrawLightning(Cloud.CFrame.p,maus.Hit.p,5,.5,BrickColor.new("New Yeller"),.2)
  376.  
  377. wait()
  378.  
  379. ltdb=false
  380.  
  381. end
  382.  
  383. end)
  384.  
  385. local Spinny = 0
  386.  
  387. local NoU = 0
  388.  
  389. while true do
  390.  
  391. Rain.Rate = (S.PlaybackLoudness + 1) * multiplier/5
  392.  
  393.  
  394. local HP = H.CFrame.p
  395.  
  396. local sizer = S.PlaybackLoudness/55 + 5
  397.  
  398. Cloud.Size = Vector3.new(sizer,1,sizer)
  399.  
  400. Shade.Range = sizer
  401.  
  402. CloudMesh.Scale = Vector3.new(sizer,5,sizer)
  403.  
  404. Cloud.CFrame = Clerp(Cloud.CFrame, CFrame.new(HP + Vector3.new(0,4,0))*CFrame.Angles(0,rad(90),0), .1)
  405.  
  406. Cloud.BrickColor = BrickColor.new(Color3.fromRGB(255 - S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2))
  407. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement