Advertisement
zXzGamePROzXz

Cloud V2 I do this

Jan 16th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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")
  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.  
  145. -- Made by Zuu_Roku w/ Help from Cass!
  146. -- Venge is ok happy? But nebby is better /e dab
  147.  
  148. print("Made by Zuu_Roku, Thanks Cass for Cloud CLerp.")
  149.  
  150. print("Rain Cloud Visualizer (Update 1.2 I guess) Commands:")
  151.  
  152. print("!play (ID) [Changes song]")
  153.  
  154. print("!pitch (#) [normal pitch is '10'][THIS IS FIXED AAAAAAAAAAAAAAAAAA, Sound.Pitch was Depreciated and never knew, hence why it never worked]")
  155.  
  156. print("!snow / !rain [Changes Weather]")
  157.  
  158. print("!rate (#) [Changes amount of particles]")
  159.  
  160. print("Click for a Lightning bolt!")
  161.  
  162.  
  163.  
  164. local Player = game.Players.LocalPlayer
  165.  
  166. local Character = Player.Character
  167.  
  168. local maus = Player:GetMouse()
  169.  
  170. local H = Character["Head"]
  171.  
  172. local multiplier = 4
  173.  
  174. local ltdb = false
  175.  
  176. local Cloud = Instance.new('Part',Character)
  177.  
  178. Cloud.Size = Vector3.new(1,1,1)
  179.  
  180. Cloud.Anchored = true
  181.  
  182. Cloud.CanCollide = false
  183.  
  184. Cloud.Transparency = 0
  185.  
  186.  
  187.  
  188. local CloudMesh = Instance.new('SpecialMesh',Cloud)
  189.  
  190. CloudMesh.Scale = Vector3.new(5,1,5)
  191.  
  192. CloudMesh.MeshId = "http://www.roblox.com/asset/?id=1095708"
  193.  
  194. CloudMesh.Offset = Vector3.new(0,1,0)
  195.  
  196.  
  197. local loudness = 0
  198.  
  199.  
  200.  
  201. local S = Instance.new('Sound',Cloud)
  202.  
  203. S.SoundId = "rbxassetid://170020261"
  204.  
  205. S.Looped = true
  206.  
  207. S.Volume = 8
  208.  
  209. S.PlaybackSpeed = 1
  210.  
  211. S.MaxDistance = 100
  212.  
  213. S:Play()
  214.  
  215.  
  216. local Volume = 5
  217.  
  218.  
  219.  
  220. local Rain = Instance.new('ParticleEmitter',Cloud)
  221.  
  222. Rain.Color = ColorSequence.new(Color3.new(1,1,1),Color3.fromRGB(175,255,255))
  223.  
  224. Rain.Size = NumberSequence.new(.5)
  225.  
  226. Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
  227.  
  228. Rain.Transparency = NumberSequence.new(0,.6)
  229.  
  230. Rain.Acceleration = Vector3.new(0,-150,0)
  231.  
  232. Rain.Lifetime = NumberRange.new(5,10)
  233.  
  234. Rain.Rate = 100
  235.  
  236.  
  237.  
  238. local Shade = Instance.new('PointLight',Cloud)
  239.  
  240. Shade.Range = 10
  241.  
  242. Shade.Color = Color3.fromRGB(50,50,50)
  243.  
  244. Shade.Enabled = true
  245.  
  246. Shade.Shadows = true
  247.  
  248.  
  249.  
  250. local rad = math.rad
  251.  
  252. local sin = math.sin
  253.  
  254. local tan = math.tan
  255.  
  256. local cos = math.cos
  257.  
  258. Player.Chatted:connect(function(m)
  259.  
  260. if m:match("!play%s%d+") then
  261.  
  262. S:Stop()
  263.  
  264. S.SoundId = "rbxassetid://"..m:match("!play%s(%d+)")
  265.  
  266. S:Play()
  267.  
  268. elseif m:match("!volume%s%d+") then
  269.  
  270. S.Volume = m:match("!volume%s(%d+)")
  271.  
  272. Volume = m:match("!volume%s(%d+)")
  273.  
  274. elseif m:match("!pitch%s%d+") then
  275.  
  276. S.PlaybackSpeed = m:match("!pitch%s(%d+)")/10
  277.  
  278. elseif m:match("!snow") then
  279.  
  280. Rain.Texture = "http://www.roblox.com/asset/?id=605668174"
  281.  
  282. Rain.Acceleration = Vector3.new(0,-10,0)
  283.  
  284. Rain.Lifetime = NumberRange.new(15,20)
  285.  
  286. Rain.Size = NumberSequence.new(.2)
  287.  
  288. elseif m:match("!rain") then
  289.  
  290. Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
  291.  
  292. Rain.Acceleration = Vector3.new(0,-150,0)
  293.  
  294. Rain.Lifetime = NumberRange.new(5,10)
  295.  
  296. Rain.Size = NumberSequence.new(.5)
  297.  
  298. elseif m:match("!rate%s%d+") then
  299.  
  300. multiplier = m:match("!rate%s(%d+)")
  301.  
  302. elseif m:match("!rr") then
  303.  
  304. print(Rain.Rate)
  305.  
  306. elseif m:match("!pbs") then
  307.  
  308. print(S.PlaybackSpeed)
  309.  
  310. elseif m:match("!rot") then
  311.  
  312. print(Cloud.Rotation)
  313.  
  314. end
  315. end)
  316.  
  317.  
  318.  
  319. function Weld(x,y)
  320.  
  321. local w = Instance.new("Weld")
  322.  
  323. w.Part0 = x
  324.  
  325. w.Part1 = y
  326.  
  327. w.Name = tostring(y.Name).."_Weld"
  328.  
  329. w.Parent = x
  330.  
  331. return w
  332.  
  333. end
  334.  
  335.  
  336.  
  337. function Clerp(start,destination,increment)
  338.  
  339. local function slerp(a,b,c)return (1-c)*a+(c*b)end
  340.  
  341. local c1 = {start.X,start.Y,start.Z,start:toEulerAnglesXYZ()}
  342.  
  343. local c2 = {destination.X,destination.Y,destination.Z,destination:toEulerAnglesXYZ()}
  344.  
  345. for i,v in pairs(c1)do c1[i] = slerp(v,c2[i],increment)end
  346.  
  347. return CFrame.new(c1[1],c1[2],c1[3])*CFrame.Angles(c1[4],c1[5],c1[6])
  348.  
  349. end
  350.  
  351.  
  352.  
  353. DrawLightning = function(Start,End,Times,Offset,Color,Thickness)
  354.  
  355. if Start.y>End.y then
  356.  
  357. local magz = (Start - End).magnitude
  358.  
  359. local curpos = Start
  360.  
  361. local trz = {-Offset,Offset}
  362.  
  363. for i=1,Times do
  364.  
  365. local li = Instance.new("Part",workspace)
  366.  
  367. li.TopSurface =10
  368.  
  369. li.BottomSurface = 10
  370.  
  371. li.Anchored = true
  372.  
  373. li.Transparency = 0
  374.  
  375. li.BrickColor = Color
  376.  
  377. li.formFactor = "Custom"
  378.  
  379. li.CanCollide = false
  380.  
  381. li.Size = Vector3.new(Thickness,Thickness,magz/Times)
  382.  
  383. local lt=Instance.new("SpotLight",li)
  384.  
  385. lt.Range=16
  386.  
  387. lt.Brightness=5
  388.  
  389. lt.Shadows=true
  390.  
  391. lt.Angle=45
  392.  
  393. lt.Face="Top"
  394.  
  395. lt.Color=li.BrickColor.Color
  396.  
  397. local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  398.  
  399. local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
  400.  
  401. if Times == i then
  402.  
  403. local magz2 = (curpos - End).magnitude
  404.  
  405. li.Size = Vector3.new(Thickness,Thickness,magz2)
  406.  
  407. li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
  408.  
  409. else
  410.  
  411. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  412.  
  413. end
  414.  
  415. 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)
  416.  
  417. end
  418.  
  419. 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
  420.  
  421. 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
  422.  
  423. end
  424.  
  425. end
  426.  
  427.  
  428.  
  429. maus.Button1Down:connect(function()
  430.  
  431. if ltdb==false then
  432.  
  433. ltdb=true
  434.  
  435. DrawLightning(Cloud.CFrame.p,maus.Hit.p,5,.5,BrickColor.new("New Yeller"),.2)
  436.  
  437. wait()
  438.  
  439. ltdb=false
  440.  
  441. end
  442.  
  443. end)
  444.  
  445. local Spinny = 0
  446.  
  447. local NoU = 0
  448.  
  449. while true do
  450.  
  451. Rain.Rate = (S.PlaybackLoudness + 1) * multiplier/5
  452.  
  453. game:GetService('RunService').RenderStepped:wait()
  454.  
  455. local HP = H.CFrame.p
  456.  
  457. local sizer = S.PlaybackLoudness/55 + 5
  458.  
  459. Cloud.Size = Vector3.new(sizer,1,sizer)
  460.  
  461. Shade.Range = sizer
  462.  
  463. CloudMesh.Scale = Vector3.new(sizer,5,sizer)
  464.  
  465. Cloud.CFrame = Clerp(Cloud.CFrame, CFrame.new(HP + Vector3.new(0,4,0))*CFrame.Angles(0,rad(90),0), .1)
  466.  
  467. Cloud.BrickColor = BrickColor.new(Color3.fromRGB(255 - S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2))
  468. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement