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