Advertisement
Void_scripter0

Cloud

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