View difference between Paste ID: 0xJsHhMz and yxfG5wJp
SHOW: | | - or go back to the newest paste.
1
--https://github.com/Mokiros/roblox-FE-compatibility
2
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
3
local Player,game,owner = owner,game
4
local RealPlayer = Player
5
do
6
	print("FE Compatibility code V2 by Mokiros")
7
	local RealPlayer = RealPlayer
8
	script.Parent = RealPlayer.Character
9
10
	--Fake event to make stuff like Mouse.KeyDown work
11
	local Disconnect_Function = function(this)
12
		this[1].Functions[this[2]] = nil
13
	end
14
	local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
15
	local FakeEvent_Metatable = {__index={
16
		Connect = function(this,f)
17
			local i = tostring(math.random(0,10000))
18
			while this.Functions[i] do
19
				i = tostring(math.random(0,10000))
20-
local Player = game.Players.LocalPlayer
20+
			end
21
			this.Functions[i] = f
22
			return setmetatable({this,i},Disconnect_Metatable)
23
		end
24-
local maus = Player:GetMouse()
24+
	}}
25
	FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
26
	local function fakeEvent()
27
		return setmetatable({Functions={}},FakeEvent_Metatable)
28
	end
29
30
	--Creating fake input objects with fake variables
31
    local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
32
    FakeMouse.keyUp = FakeMouse.KeyUp
33
    FakeMouse.keyDown = FakeMouse.KeyDown
34
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
35
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
36
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
37
	end}
38
	--Merged 2 functions into one by checking amount of arguments
39
	CAS.UnbindAction = CAS.BindAction
40
41
	--This function will trigger the events that have been :Connect()'ed
42
	local function TriggerEvent(self,ev,...)
43
		for _,f in pairs(self[ev].Functions) do
44
			f(...)
45
		end
46
	end
47
	FakeMouse.TriggerEvent = TriggerEvent
48
	UIS.TriggerEvent = TriggerEvent
49
50
	--Client communication
51
	local Event = Instance.new("RemoteEvent")
52
	Event.Name = "UserInput_Event"
53
	Event.OnServerEvent:Connect(function(plr,io)
54
	    if plr~=RealPlayer then return end
55
		FakeMouse.Target = io.Target
56
		FakeMouse.Hit = io.Hit
57
		if not io.isMouse then
58
			local b = io.UserInputState == Enum.UserInputState.Begin
59-
S.SoundId = "rbxassetid://170020261"
59+
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
60
				return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
61
			end
62
			if io.UserInputType == Enum.UserInputType.MouseButton2 then
63
				return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
64
			end
65
			for _,t in pairs(CAS.Actions) do
66
				for _,k in pairs(t.Keys) do
67
					if k==io.KeyCode then
68
						t.Function(t.Name,io.UserInputState,io)
69
					end
70
				end
71
			end
72
			FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
73
			UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
74
	    end
75
	end)
76
	Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
77
	local Mouse = owner:GetMouse()
78
	local UIS = game:GetService("UserInputService")
79
	local input = function(io,RobloxHandled)
80
		if RobloxHandled then return end
81
		--Since InputObject is a client-side instance, we create and pass table instead
82
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
83
	end
84
	UIS.InputBegan:Connect(input)
85
	UIS.InputEnded:Connect(input)
86
87
	local h,t
88
	--Give the server mouse data every second frame, but only if the values changed
89
	--If player is not moving their mouse, client won't fire events
90
	local HB = game:GetService("RunService").Heartbeat
91
	while true do
92
		if h~=Mouse.Hit or t~=Mouse.Target then
93
			h,t=Mouse.Hit,Mouse.Target
94
			Event:FireServer({isMouse=true,Target=t,Hit=h})
95
		end
96
		--Wait 2 frames
97
		for i=1,2 do
98
			HB:Wait()
99
		end
100
	end]==],script)
101
102
	----Sandboxed game object that allows the usage of client-side methods and services
103
	--Real game object
104
	local RealGame = game
105
106
	--Metatable for fake service
107
	local FakeService_Metatable = {
108
		__index = function(self,k)
109
			local s = rawget(self,"_RealService")
110
			if s then
111
				return typeof(s[k])=="function"
112
				and function(_,...)return s[k](s,...)end or s[k]
113
			end
114
		end,
115
		__newindex = function(self,k,v)
116
			local s = rawget(self,"_RealService")
117
			if s then s[k]=v end
118
		end
119
	}
120
	local function FakeService(t,RealService)
121
		t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
122
		return setmetatable(t,FakeService_Metatable)
123
	end
124
125
	--Fake game object
126
	local FakeGame = {
127
		GetService = function(self,s)
128
			return rawget(self,s) or RealGame:GetService(s)
129
		end,
130
		Players = FakeService({
131
			LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
132
		},"Players"),
133
		UserInputService = FakeService(UIS,"UserInputService"),
134
		ContextActionService = FakeService(CAS,"ContextActionService"),
135
		RunService = FakeService({
136
			_btrs = {},
137
			RenderStepped = RealGame:GetService("RunService").Heartbeat,
138
			BindToRenderStep = function(self,name,_,fun)
139
				self._btrs[name] = self.Heartbeat:Connect(fun)
140
			end,
141
			UnbindFromRenderStep = function(self,name)
142
				self._btrs[name]:Disconnect()
143
			end,
144
		},"RunService")
145
	}
146
	rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
147
	FakeGame.service = FakeGame.GetService
148
	FakeService(FakeGame,game)
149
	--Changing owner to fake player object to support owner:GetMouse()
150
	game,owner = FakeGame,FakeGame.Players.LocalPlayer
151
end
152
153
-- Made by Zuu_Roku w/ Help from Cass!
154
-- Venge is ok happy? But nebby is better /e dab
155
156
print("Made by Zuu_Roku, Thanks Cass for Cloud CLerp.")
157
158
print("Rain Cloud Visualizer (Update 1.2 I guess) Commands:")
159
160
print("!play (ID) [Changes song]")
161
162
print("!pitch (#) [normal pitch is '10'][THIS IS FIXED AAAAAAAAAAAAAAAAAA, Sound.Pitch was Depreciated and never knew, hence why it never worked]")
163
164
print("!snow / !rain [Changes Weather]")
165
166
print("!rate (#) [Changes amount of particles]")
167
168
print("Click for a Lightning bolt!")
169
170
171
172
local Player = owner
173
174
local Character = Player.Character
175
176
177
local H = Character["Head"]
178
179
local multiplier = 4
180
181
local ltdb = false
182
183
local Cloud = Instance.new('Part',Character)
184
185
Cloud.Size = Vector3.new(1,1,1)
186
187
Cloud.Anchored = true
188
189
Cloud.CanCollide = false
190
191
Cloud.Transparency = 0
192
193
194
195
local CloudMesh = Instance.new('SpecialMesh',Cloud)
196
197
CloudMesh.Scale = Vector3.new(5,1,5)
198
199
CloudMesh.MeshId = "http://www.roblox.com/asset/?id=1095708"
200
201
CloudMesh.Offset = Vector3.new(0,1,0)
202
203
204
local loudness = 0
205
206
207
208
local S = Instance.new('Sound',Cloud)
209
210
S.SoundId = "rbxassetid://279207008"
211
212
S.Looped = true
213
214
S.Volume = 8
215
216
S.PlaybackSpeed = 1
217
218
S.MaxDistance = 100
219
220
S:Play()
221
222
223
local Volume = 5
224
225
226
227
local Rain = Instance.new('ParticleEmitter',Cloud)
228
229
Rain.Color = ColorSequence.new(Color3.new(1,1,1),Color3.fromRGB(175,255,255))
230
231
Rain.Size = NumberSequence.new(.5)
232
233
Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
234
235
Rain.Transparency = NumberSequence.new(0,.6)
236
237
Rain.Acceleration = Vector3.new(0,-150,0)
238
239
Rain.Lifetime = NumberRange.new(5,10)
240
241
Rain.Rate = 100
242
243
244
245
local Shade = Instance.new('PointLight',Cloud)
246
247
Shade.Range = 10
248
249
Shade.Color = Color3.fromRGB(50,50,50)
250
251
Shade.Enabled = true
252
253
Shade.Shadows = true
254
255
256
257
local rad = math.rad
258
259
local sin = math.sin
260
261
local tan = math.tan
262
263
local cos = math.cos
264
265
Player.Chatted:connect(function(m)
266
267
	if m:match("!play%s%d+") then
268
269
		S:Stop()
270
271
		S.SoundId = "rbxassetid://"..m:match("!play%s(%d+)")
272
273
		S:Play()
274
275
	elseif m:match("!volume%s%d+") then
276
277
		S.Volume = m:match("!volume%s(%d+)")
278
279
		Volume = m:match("!volume%s(%d+)")
280
281
	elseif m:match("!pitch%s%d+") then
282
283
		S.PlaybackSpeed = m:match("!pitch%s(%d+)")/10
284
285-
maus.Button1Down:connect(function()
285+
286
287-
if ltdb==false then
287+
288
289-
ltdb=true
289+
290
291-
DrawLightning(Cloud.CFrame.p,maus.Hit.p,5,.5,BrickColor.new("New Yeller"),.2)
291+
292
293-
wait()
293+
294
295-
ltdb=false
295+
296
297
		Rain.Texture = "http://www.roblox.com/asset/?id=241876428"
298
299
		Rain.Acceleration = Vector3.new(0,-150,0)
300
301
		Rain.Lifetime = NumberRange.new(5,10)
302
303
		Rain.Size = NumberSequence.new(.5)
304
305
	elseif m:match("!rate%s%d+") then
306
307
		multiplier = m:match("!rate%s(%d+)")
308
309
	elseif m:match("!rr") then
310
311
		print(Rain.Rate)
312
313
	elseif m:match("!pbs") then
314
	
315
		print(S.PlaybackSpeed)
316
317
	elseif m:match("!rot") then
318
319
		print(Cloud.Rotation)
320
321
	end
322
end)
323
324
325
326
function Weld(x,y)
327
328
	local w = Instance.new("Weld")
329
330
	w.Part0 = x
331
332
	w.Part1 = y
333
334
	w.Name = tostring(y.Name).."_Weld"
335
336
	w.Parent = x
337
338
	return w
339
340
end
341
342
343
344
function Clerp(start,destination,increment)
345
346
    local function slerp(a,b,c)return (1-c)*a+(c*b)end
347
348
    local c1 = {start.X,start.Y,start.Z,start:toEulerAnglesXYZ()}
349
350
    local c2 = {destination.X,destination.Y,destination.Z,destination:toEulerAnglesXYZ()}
351
352
    for i,v in pairs(c1)do c1[i] = slerp(v,c2[i],increment)end
353
354
    return CFrame.new(c1[1],c1[2],c1[3])*CFrame.Angles(c1[4],c1[5],c1[6])
355
356
end
357
358
359
360
DrawLightning = function(Start,End,Times,Offset,Color,Thickness)
361
362
if Start.y>End.y then
363
364
local magz = (Start - End).magnitude 
365
366
local curpos = Start 
367
368
local trz = {-Offset,Offset}
369
370
for i=1,Times do 
371
372
local li = Instance.new("Part",workspace) 
373
374
li.TopSurface =10 
375
376
li.BottomSurface = 10 
377
378
li.Anchored = true  
379
380
li.Transparency = 0 
381
382
li.BrickColor = Color
383
384
li.formFactor = "Custom" 
385
386
li.CanCollide = false 
387
388
li.Size = Vector3.new(Thickness,Thickness,magz/Times) 
389
390
local lt=Instance.new("SpotLight",li)
391
392
lt.Range=16
393
394
lt.Brightness=5
395
396
lt.Shadows=true
397
398
lt.Angle=45
399
400
lt.Face="Top"
401
402
lt.Color=li.BrickColor.Color
403
404
local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)]) 
405
406
local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
407
408
if Times == i then 
409
410
local magz2 = (curpos - End).magnitude 
411
412
li.Size = Vector3.new(Thickness,Thickness,magz2)
413
414
li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
415
416
else
417
418
li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
419
420
end
421
422
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)
423
424
end
425
426
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
427
428
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
429
430
end
431
432
end
433
434
435
436
437
438
local Spinny = 0
439
440
local NoU = 0
441
442
while true do
443
	
444
	Rain.Rate = (S.PlaybackLoudness + 1) * multiplier/5
445
446
	game:GetService('RunService').RenderStepped:wait()
447
448
	local HP = H.CFrame.p
449
450
	local sizer = S.PlaybackLoudness/55 + 5
451
	
452
	Cloud.Size = Vector3.new(sizer,1,sizer)
453
	
454
	Shade.Range = sizer
455
456
	CloudMesh.Scale = Vector3.new(sizer,5,sizer)
457
458
	Cloud.CFrame = Clerp(Cloud.CFrame, CFrame.new(HP + Vector3.new(0,4,0))*CFrame.Angles(0,rad(90),0), .1)
459
460
	Cloud.BrickColor = BrickColor.new(Color3.fromRGB(255 - S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2))
461
end