View difference between Paste ID: BaYg1EjY and yxfG5wJp
SHOW: | | - or go back to the newest paste.
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 Player = game.Players.LocalPlayer
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
-- Made by Zuu_Roku w/ Help from Cass!
84
-- Venge is ok happy? But nebby is better /e dab
85
86
print("Made by Zuu_Roku, Thanks Cass for Cloud CLerp.")
87
88
print("Rain Cloud Visualizer (Update 1.2 I guess) Commands:")
89
90
print("!play (ID) [Changes song]")
91
92
print("!pitch (#) [normal pitch is '10'][THIS IS FIXED AAAAAAAAAAAAAAAAAA, Sound.Pitch was Depreciated and never knew, hence why it never worked]")
93
94
print("!snow / !rain [Changes Weather]")
95
96
print("!rate (#) [Changes amount of particles]")
97
98
print("Click for a Lightning bolt!")
99
100
101
102
local Player = owner
103
104
local Character = Player.Character
105
106
local maus = Player:GetMouse()
107
108
local H = Character["Head"]
109
110
local multiplier = 4
111
112
local ltdb = false
113
114
local Cloud = Instance.new('Part',Character)
115
116
Cloud.Size = Vector3.new(1,1,1)
117
118
Cloud.Anchored = true
119
120
Cloud.CanCollide = false
121
122
Cloud.Transparency = 0
123
124
125
126
local CloudMesh = Instance.new('SpecialMesh',Cloud)
127
128
CloudMesh.Scale = Vector3.new(5,1,5)
129
130
CloudMesh.MeshId = "http://www.roblox.com/asset/?id=1095708"
131
132
CloudMesh.Offset = Vector3.new(0,1,0)
133
134
135
local loudness = 0
136
137
138
139
local S = Instance.new('Sound',Cloud)
140
141
S.SoundId = "rbxassetid://170020261"
142
143
S.Looped = true
144
145
S.Volume = 8
146
147
S.PlaybackSpeed = 1
148
149
S.MaxDistance = 100
150
151
S:Play()
152
153
154
local Volume = 5
155
156
157
158
local Rain = Instance.new('ParticleEmitter',Cloud)
159
160
Rain.Color = ColorSequence.new(Color3.new(1,1,1),Color3.fromRGB(175,255,255))
161
162
Rain.Size = NumberSequence.new(.5)
163
164
Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
165
166
Rain.Transparency = NumberSequence.new(0,.6)
167
168
Rain.Acceleration = Vector3.new(0,-150,0)
169
170
Rain.Lifetime = NumberRange.new(5,10)
171
172
Rain.Rate = 100
173
174
175
176
local Shade = Instance.new('PointLight',Cloud)
177
178
Shade.Range = 10
179
180
Shade.Color = Color3.fromRGB(50,50,50)
181
182
Shade.Enabled = true
183
184
Shade.Shadows = true
185
186
187
188
local rad = math.rad
189
190
local sin = math.sin
191
192
local tan = math.tan
193
194
local cos = math.cos
195
196
Player.Chatted:connect(function(m)
197
198
	if m:match("!play%s%d+") then
199
200
		S:Stop()
201
202
		S.SoundId = "rbxassetid://"..m:match("!play%s(%d+)")
203
204
		S:Play()
205
206
	elseif m:match("!volume%s%d+") then
207
208
		S.Volume = m:match("!volume%s(%d+)")
209
210
		Volume = m:match("!volume%s(%d+)")
211
212
	elseif m:match("!pitch%s%d+") then
213
214
		S.PlaybackSpeed = m:match("!pitch%s(%d+)")/10
215
216
	elseif m:match("!snow") then
217
218
		Rain.Texture = "http://www.roblox.com/asset/?id=605668174"
219
220
		Rain.Acceleration = Vector3.new(0,-10,0)
221
222
		Rain.Lifetime = NumberRange.new(15,20)
223
224
		Rain.Size = NumberSequence.new(.2)
225
226
	elseif m:match("!rain") then
227
228
		Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
229
230
		Rain.Acceleration = Vector3.new(0,-150,0)
231
232
		Rain.Lifetime = NumberRange.new(5,10)
233
234
		Rain.Size = NumberSequence.new(.5)
235
236
	elseif m:match("!rate%s%d+") then
237
238
		multiplier = m:match("!rate%s(%d+)")
239
240
	elseif m:match("!rr") then
241
242
		print(Rain.Rate)
243
244
	elseif m:match("!pbs") then
245
	
246
		print(S.PlaybackSpeed)
247
248
	elseif m:match("!rot") then
249
250
		print(Cloud.Rotation)
251
252
	end
253
end)
254
255
256
257
function Weld(x,y)
258
259
	local w = Instance.new("Weld")
260
261
	w.Part0 = x
262
263
	w.Part1 = y
264
265
	w.Name = tostring(y.Name).."_Weld"
266
267
	w.Parent = x
268
269
	return w
270
271
end
272
273
274
275
function Clerp(start,destination,increment)
276
277
    local function slerp(a,b,c)return (1-c)*a+(c*b)end
278
279
    local c1 = {start.X,start.Y,start.Z,start:toEulerAnglesXYZ()}
280
281
    local c2 = {destination.X,destination.Y,destination.Z,destination:toEulerAnglesXYZ()}
282
283
    for i,v in pairs(c1)do c1[i] = slerp(v,c2[i],increment)end
284
285
    return CFrame.new(c1[1],c1[2],c1[3])*CFrame.Angles(c1[4],c1[5],c1[6])
286
287
end
288
289
290
291
DrawLightning = function(Start,End,Times,Offset,Color,Thickness)
292
293
if Start.y>End.y then
294
295
local magz = (Start - End).magnitude 
296
297
local curpos = Start 
298
299
local trz = {-Offset,Offset}
300
301
for i=1,Times do 
302
303
local li = Instance.new("Part",workspace) 
304
305
li.TopSurface =10 
306
307
li.BottomSurface = 10 
308
309
li.Anchored = true  
310
311
li.Transparency = 0 
312
313
li.BrickColor = Color
314
315
li.formFactor = "Custom" 
316
317
li.CanCollide = false 
318
319
li.Size = Vector3.new(Thickness,Thickness,magz/Times) 
320
321
local lt=Instance.new("SpotLight",li)
322
323
lt.Range=16
324
325
lt.Brightness=5
326
327
lt.Shadows=true
328
329
lt.Angle=45
330
331
lt.Face="Top"
332
333
lt.Color=li.BrickColor.Color
334
335
local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)]) 
336
337
local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
338
339
if Times == i then 
340
341
local magz2 = (curpos - End).magnitude 
342
343
li.Size = Vector3.new(Thickness,Thickness,magz2)
344
345
li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
346
347
else
348
349
li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
350
351
end
352
353
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)
354
355
end
356
357
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
358
359
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
360
361
end
362
363
end
364
365
366
367
maus.Button1Down:connect(function()
368
369
if ltdb==false then
370
371
ltdb=true
372
373
DrawLightning(Cloud.CFrame.p,maus.Hit.p,5,.5,BrickColor.new("New Yeller"),.2)
374
375
wait()
376
377
ltdb=false
378
379
end
380
381
end)
382
383
local Spinny = 0
384
385
local NoU = 0
386
387
while true do
388
	
389
	Rain.Rate = (S.PlaybackLoudness + 1) * multiplier/5
390
391
	game:GetService('RunService').RenderStepped:wait()
392
393
	local HP = H.CFrame.p
394
395
	local sizer = S.PlaybackLoudness/55 + 5
396
	
397
	Cloud.Size = Vector3.new(sizer,1,sizer)
398
	
399
	Shade.Range = sizer
400
401
	CloudMesh.Scale = Vector3.new(sizer,5,sizer)
402
403
	Cloud.CFrame = Clerp(Cloud.CFrame, CFrame.new(HP + Vector3.new(0,4,0))*CFrame.Angles(0,rad(90),0), .1)
404
405
	Cloud.BrickColor = BrickColor.new(Color3.fromRGB(255 - S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2))
406
end