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 | end | |
21 | this.Functions[i] = f | |
22 | return setmetatable({this,i},Disconnect_Metatable) | |
23 | end | |
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 | 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 = game.Players.LocalPlayer | |
173 | ||
174 | local Character = Player.Character | |
175 | ||
176 | local maus = Player:GetMouse() | |
177 | ||
178 | local H = Character["Head"] | |
179 | ||
180 | local multiplier = 4 | |
181 | ||
182 | local ltdb = false | |
183 | ||
184 | local Cloud = Instance.new('Part',Character) | |
185 | ||
186 | Cloud.Size = Vector3.new(1,1,1) | |
187 | ||
188 | Cloud.Anchored = true | |
189 | ||
190 | Cloud.CanCollide = false | |
191 | ||
192 | Cloud.Transparency = 0 | |
193 | ||
194 | ||
195 | ||
196 | local CloudMesh = Instance.new('SpecialMesh',Cloud) | |
197 | ||
198 | CloudMesh.Scale = Vector3.new(5,1,5) | |
199 | ||
200 | CloudMesh.MeshId = "http://www.roblox.com/asset/?id=1095708" | |
201 | ||
202 | CloudMesh.Offset = Vector3.new(0,1,0) | |
203 | ||
204 | ||
205 | local loudness = 0 | |
206 | ||
207 | ||
208 | ||
209 | local S = Instance.new('Sound',Cloud) | |
210 | ||
211 | S.SoundId = "rbxassetid://170020261" | |
212 | ||
213 | S.Looped = true | |
214 | ||
215 | S.Volume = 8 | |
216 | ||
217 | S.PlaybackSpeed = 1 | |
218 | ||
219 | S.MaxDistance = 100 | |
220 | ||
221 | S:Play() | |
222 | ||
223 | ||
224 | local Volume = 5 | |
225 | ||
226 | ||
227 | ||
228 | local Rain = Instance.new('ParticleEmitter',Cloud) | |
229 | ||
230 | Rain.Color = ColorSequence.new(Color3.new(1,1,1),Color3.fromRGB(175,255,255)) | |
231 | ||
232 | Rain.Size = NumberSequence.new(.5) | |
233 | ||
234 | Rain.Texture = "http://www.roblox.com/asset/?id=241876428" | |
235 | ||
236 | Rain.Transparency = NumberSequence.new(0,.6) | |
237 | ||
238 | Rain.Acceleration = Vector3.new(0,-150,0) | |
239 | ||
240 | Rain.Lifetime = NumberRange.new(5,10) | |
241 | ||
242 | Rain.Rate = 100 | |
243 | ||
244 | ||
245 | ||
246 | local Shade = Instance.new('PointLight',Cloud) | |
247 | ||
248 | Shade.Range = 10 | |
249 | ||
250 | Shade.Color = Color3.fromRGB(50,50,50) | |
251 | ||
252 | Shade.Enabled = true | |
253 | ||
254 | Shade.Shadows = true | |
255 | ||
256 | ||
257 | ||
258 | local rad = math.rad | |
259 | ||
260 | local sin = math.sin | |
261 | ||
262 | local tan = math.tan | |
263 | ||
264 | local cos = math.cos | |
265 | ||
266 | Player.Chatted:connect(function(m) | |
267 | ||
268 | if m:match("!play%s%d+") then | |
269 | ||
270 | S:Stop() | |
271 | ||
272 | S.SoundId = "rbxassetid://"..m:match("!play%s(%d+)") | |
273 | ||
274 | S:Play() | |
275 | ||
276 | elseif m:match("!volume%s%d+") then | |
277 | ||
278 | S.Volume = m:match("!volume%s(%d+)") | |
279 | ||
280 | Volume = m:match("!volume%s(%d+)") | |
281 | ||
282 | elseif m:match("!pitch%s%d+") then | |
283 | ||
284 | S.PlaybackSpeed = m:match("!pitch%s(%d+)")/10 | |
285 | ||
286 | elseif m:match("!snow") then | |
287 | ||
288 | Rain.Texture = "http://www.roblox.com/asset/?id=605668174" | |
289 | ||
290 | Rain.Acceleration = Vector3.new(0,-10,0) | |
291 | ||
292 | Rain.Lifetime = NumberRange.new(15,20) | |
293 | ||
294 | Rain.Size = NumberSequence.new(.2) | |
295 | ||
296 | elseif m:match("!rain") then | |
297 | ||
298 | Rain.Texture = "http://www.roblox.com/asset/?id=241876428" | |
299 | ||
300 | Rain.Acceleration = Vector3.new(0,-150,0) | |
301 | ||
302 | Rain.Lifetime = NumberRange.new(5,10) | |
303 | ||
304 | Rain.Size = NumberSequence.new(.5) | |
305 | ||
306 | elseif m:match("!rate%s%d+") then | |
307 | ||
308 | multiplier = m:match("!rate%s(%d+)") | |
309 | ||
310 | elseif m:match("!rr") then | |
311 | ||
312 | print(Rain.Rate) | |
313 | ||
314 | elseif m:match("!pbs") then | |
315 | ||
316 | print(S.PlaybackSpeed) | |
317 | ||
318 | elseif m:match("!rot") then | |
319 | ||
320 | print(Cloud.Rotation) | |
321 | ||
322 | end | |
323 | end) | |
324 | ||
325 | ||
326 | ||
327 | function Weld(x,y) | |
328 | ||
329 | local w = Instance.new("Weld") | |
330 | ||
331 | w.Part0 = x | |
332 | ||
333 | w.Part1 = y | |
334 | ||
335 | w.Name = tostring(y.Name).."_Weld" | |
336 | ||
337 | w.Parent = x | |
338 | ||
339 | return w | |
340 | ||
341 | end | |
342 | ||
343 | ||
344 | ||
345 | function Clerp(start,destination,increment) | |
346 | ||
347 | local function slerp(a,b,c)return (1-c)*a+(c*b)end | |
348 | ||
349 | local c1 = {start.X,start.Y,start.Z,start:toEulerAnglesXYZ()} | |
350 | ||
351 | local c2 = {destination.X,destination.Y,destination.Z,destination:toEulerAnglesXYZ()} | |
352 | ||
353 | for i,v in pairs(c1)do c1[i] = slerp(v,c2[i],increment)end | |
354 | ||
355 | return CFrame.new(c1[1],c1[2],c1[3])*CFrame.Angles(c1[4],c1[5],c1[6]) | |
356 | ||
357 | end | |
358 | ||
359 | ||
360 | ||
361 | DrawLightning = function(Start,End,Times,Offset,Color,Thickness) | |
362 | ||
363 | if Start.y>End.y then | |
364 | ||
365 | local magz = (Start - End).magnitude | |
366 | ||
367 | local curpos = Start | |
368 | ||
369 | local trz = {-Offset,Offset} | |
370 | ||
371 | for i=1,Times do | |
372 | ||
373 | local li = Instance.new("Part",workspace) | |
374 | ||
375 | li.TopSurface =10 | |
376 | ||
377 | li.BottomSurface = 10 | |
378 | ||
379 | li.Anchored = true | |
380 | ||
381 | li.Transparency = 0 | |
382 | ||
383 | li.BrickColor = Color | |
384 | ||
385 | li.formFactor = "Custom" | |
386 | ||
387 | li.CanCollide = false | |
388 | ||
389 | li.Size = Vector3.new(Thickness,Thickness,magz/Times) | |
390 | ||
391 | local lt=Instance.new("SpotLight",li) | |
392 | ||
393 | lt.Range=16 | |
394 | ||
395 | lt.Brightness=5 | |
396 | ||
397 | lt.Shadows=true | |
398 | ||
399 | lt.Angle=45 | |
400 | ||
401 | lt.Face="Top" | |
402 | ||
403 | lt.Color=li.BrickColor.Color | |
404 | ||
405 | local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)]) | |
406 | ||
407 | local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz | |
408 | ||
409 | if Times == i then | |
410 | ||
411 | local magz2 = (curpos - End).magnitude | |
412 | ||
413 | li.Size = Vector3.new(Thickness,Thickness,magz2) | |
414 | ||
415 | li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2) | |
416 | ||
417 | else | |
418 | ||
419 | li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2) | |
420 | ||
421 | end | |
422 | ||
423 | 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) | |
424 | ||
425 | end | |
426 | ||
427 | 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 | |
428 | ||
429 | 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 | |
430 | ||
431 | end | |
432 | ||
433 | end | |
434 | ||
435 | ||
436 | ||
437 | maus.Button1Down:connect(function() | |
438 | ||
439 | if ltdb==false then | |
440 | ||
441 | ltdb=true | |
442 | ||
443 | DrawLightning(Cloud.CFrame.p,maus.Hit.p,5,.5,BrickColor.new("New Yeller"),.2) | |
444 | ||
445 | wait() | |
446 | ||
447 | ltdb=false | |
448 | ||
449 | end | |
450 | ||
451 | end) | |
452 | ||
453 | local Spinny = 0 | |
454 | ||
455 | local NoU = 0 | |
456 | ||
457 | while true do | |
458 | ||
459 | Rain.Rate = (S.PlaybackLoudness + 1) * multiplier/5 | |
460 | ||
461 | game:GetService('RunService').RenderStepped:wait() | |
462 | ||
463 | local HP = H.CFrame.p | |
464 | ||
465 | local sizer = S.PlaybackLoudness/55 + 5 | |
466 | ||
467 | Cloud.Size = Vector3.new(sizer,1,sizer) | |
468 | ||
469 | Shade.Range = sizer | |
470 | ||
471 | CloudMesh.Scale = Vector3.new(sizer,5,sizer) | |
472 | ||
473 | Cloud.CFrame = Clerp(Cloud.CFrame, CFrame.new(HP + Vector3.new(0,4,0))*CFrame.Angles(0,rad(90),0), .1) | |
474 | ||
475 | Cloud.BrickColor = BrickColor.new(Color3.fromRGB(255 - S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2, 255-S.PlaybackLoudness/2)) | |
476 | end |