Shocker130000

Cloud vis

May 28th, 2018
4,791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.01 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,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. ---[[ Cloud "Visualizer", Rushed out and made by Zuu_Roku, Credits to Cass for being a cool dood]]---
  91.  
  92. print("Made by Zuu_Roku, Commands are !play !snow !rain !multiplier and !volume")
  93.  
  94. print("Credits to Cass / PPATTA for being a cool dood")
  95.  
  96.  
  97. local Player = owner
  98.  
  99. local Character = Player.Character
  100.  
  101. local H = Character["Head"]
  102.  
  103. local multiplier = 4
  104.  
  105. local Cloud = Instance.new('Part',Character)
  106.  
  107. Cloud.Size = Vector3.new(20,15,20)
  108.  
  109. Cloud.Anchored = true
  110.  
  111. Cloud.CanCollide = false
  112.  
  113. Cloud.Transparency = 0
  114.  
  115.  
  116.  
  117. local CloudMesh = Instance.new('SpecialMesh',Cloud)
  118.  
  119. CloudMesh.Scale = Vector3.new(25,10,25)
  120.  
  121. CloudMesh.MeshId = "http://www.roblox.com/asset/?id=1095708"
  122.  
  123. CloudMesh.Offset = Vector3.new(0,10,0)
  124.  
  125.  
  126. local loudness = 0
  127.  
  128.  
  129.  
  130. local S = Instance.new('Sound',Cloud)
  131.  
  132. S.SoundId = "rbxassetid://274727125"
  133.  
  134. S.Looped = true
  135.  
  136. S.Volume = 8
  137.  
  138. S.MaxDistance = 100
  139.  
  140. S:Play()
  141.  
  142.  
  143.  
  144. local Rain = Instance.new('ParticleEmitter',Cloud)
  145.  
  146. Rain.Color = ColorSequence.new(Color3.new(1,1,1),Color3.fromRGB(175,255,255))
  147.  
  148. Rain.Size = NumberSequence.new(.5)
  149.  
  150. Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
  151.  
  152. Rain.Transparency = NumberSequence.new(0,.6)
  153.  
  154. Rain.Acceleration = Vector3.new(0,-150,0)
  155.  
  156. Rain.Lifetime = NumberRange.new(5,10)
  157.  
  158. Rain.Rate = 100
  159.  
  160. local rad = math.rad
  161.  
  162. local sin = math.sin
  163.  
  164. local tan = math.tan
  165.  
  166. local cos = math.cos
  167.  
  168. Player.Chatted:connect(function(m)
  169.  
  170. if m:match("!play%s%d+") then
  171.  
  172. S:Stop()
  173.  
  174. S.SoundId = "rbxassetid://"..m:match("!play%s(%d+)")
  175.  
  176. S:Play()
  177.  
  178. elseif m:match("!volume%s%d+") then
  179.  
  180. S.Volume = m:match("!volume%s(%d+)")
  181.  
  182. elseif m:match("!pitch%s%d+") then
  183.  
  184. S.Pitch = m:match("!volume%s(%d+)")
  185.  
  186. elseif m:match("!snow") then
  187.  
  188. Rain.Texture = "http://www.roblox.com/asset/?id=605668174"
  189.  
  190. Rain.Acceleration = Vector3.new(0,-10,0)
  191.  
  192. Rain.Lifetime = NumberRange.new(15,20)
  193.  
  194. Rain.Size = NumberSequence.new(.2)
  195.  
  196. elseif m:match("!rain") then
  197.  
  198. Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
  199.  
  200. Rain.Acceleration = Vector3.new(0,-150,0)
  201.  
  202. Rain.Lifetime = NumberRange.new(5,10)
  203.  
  204. Rain.Size = NumberSequence.new(.5)
  205.  
  206. elseif m:match("!multiplier%s%d+") then
  207.  
  208. multiplier = m:match("!multiplier%s(%d+)")
  209.  
  210. elseif m:match("!rr") then
  211.  
  212. print(Rain.Rate)
  213.  
  214. end
  215. end)
  216.  
  217.  
  218.  
  219. function Weld(x,y)
  220.  
  221. local w = Instance.new("Weld")
  222.  
  223. w.Part0 = x
  224.  
  225. w.Part1 = y
  226.  
  227. w.Name = tostring(y.Name).."_Weld"
  228.  
  229. w.Parent = x
  230.  
  231. return w
  232.  
  233. end
  234.  
  235.  
  236.  
  237. function Clerp(start,destination,increment)
  238.  
  239. local function slerp(a,b,c)return (1-c)*a+(c*b)end
  240.  
  241. local c1 = {start.X,start.Y,start.Z,start:toEulerAnglesXYZ()}
  242.  
  243. local c2 = {destination.X,destination.Y,destination.Z,destination:toEulerAnglesXYZ()}
  244.  
  245. for i,v in pairs(c1)do c1[i] = slerp(v,c2[i],increment)end
  246.  
  247. return CFrame.new(c1[1],c1[2],c1[3])*CFrame.Angles(c1[4],c1[5],c1[6])
  248.  
  249. end
  250.  
  251.  
  252.  
  253. while true do
  254.  
  255. Rain.Rate = (S.PlaybackLoudness + 50) * multiplier
  256.  
  257.  
  258.  
  259. local HP = H.CFrame.p
  260.  
  261. local sizer = S.PlaybackLoudness/50 + 15
  262.  
  263. Cloud.Size = Vector3.new(sizer,15,sizer)
  264.  
  265. CloudMesh.Scale = Vector3.new(sizer,10,sizer)
  266.  
  267. end
Add Comment
Please, Sign In to add comment