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