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 | --Script made by Pedrorb03 | |
154 | growingList = {} | |
155 | degrowingList = {} | |
156 | ||
157 | torso = Instance.new("Part") torso.Size = Vector3.new(0,0,0) torso.CanCollide = false | |
158 | torso.Anchored = true | |
159 | local mesh = Instance.new("SpecialMesh",torso) mesh.MeshId = "rbxassetid://1198391230" mesh.TextureId = "rbxassetid://1198391349" mesh.Scale = Vector3.new(0.01,0.01,0.01) | |
160 | ||
161 | arm = Instance.new("Part") arm.Size = Vector3.new(0,0,0) arm.CanCollide = false | |
162 | arm.Anchored = true | |
163 | local mesh = Instance.new("SpecialMesh",arm) mesh.MeshId = "rbxassetid://1198392540" mesh.TextureId = "rbxassetid://1198391349" mesh.Scale = Vector3.new(0.02,0.02,0.02) | |
164 | ||
165 | leg1 = Instance.new("Part") leg1.Size = Vector3.new(0,0,0) leg1.CanCollide = false | |
166 | leg1.Anchored = true | |
167 | local mesh = Instance.new("SpecialMesh",leg1) mesh.MeshId = "rbxassetid://1198394446" mesh.TextureId = "rbxassetid://1198391349" mesh.Scale = Vector3.new(0.01,0.01,0.01) | |
168 | ||
169 | leg2 = Instance.new("Part") leg2.Size = Vector3.new(0,0,0) leg2.CanCollide = false | |
170 | leg2.Anchored = true | |
171 | local mesh = Instance.new("SpecialMesh",leg2) mesh.MeshId = "rbxassetid://1198393506" mesh.TextureId = "rbxassetid://1198391349" mesh.Scale = Vector3.new(0.02,0.02,0.02) | |
172 | ||
173 | headd = Instance.new("Part") headd.Size = Vector3.new(1,1,1) headd.CanCollide = false | |
174 | local mesh = Instance.new("SpecialMesh",headd) mesh.Scale = Vector3.new(1.25,1.25,1.25) mesh.MeshType = Enum.MeshType.Head | |
175 | headd.BrickColor = BrickColor.new("Pastel brown") | |
176 | ||
177 | game:GetService("RunService").RenderStepped:connect(function() | |
178 | for _,grow in pairs(growingList) do | |
179 | local cframe = grow.CFrame | |
180 | grow.Size = grow.Size+Vector3.new(1,1,1) | |
181 | grow.Transparency = grow.Transparency+0.04 | |
182 | end | |
183 | for _,degrow in pairs(degrowingList) do | |
184 | local cframe = degrow.CFrame | |
185 | degrow.Size = degrow.Size-Vector3.new(1,1,1) | |
186 | degrow.Transparency = degrow.Transparency+0.04 | |
187 | end | |
188 | end) | |
189 | ||
190 | ||
191 | ||
192 | ||
193 | Basesong = Instance.new("Sound") | |
194 | ||
195 | hair = Instance.new("Part",game.Players.LocalPlayer.Character) hair.Size = Vector3.new(1,1,1) hair.CanCollide = false | |
196 | ||
197 | beforesong = Basesong:Clone() | |
198 | beforesong.Parent = game.Players.LocalPlayer.Character | |
199 | beforesong.Looped = true | |
200 | beforesong.Volume = 3 | |
201 | beforesong.SoundId = "rbxassetid://1100971847" | |
202 | beforesong:Play() | |
203 | ||
204 | if game.Players.LocalPlayer.Character:FindFirstChild("Body Colors") then | |
205 | game.Players.LocalPlayer.Character["Body Colors"]:remove() | |
206 | end | |
207 | if game.Players.LocalPlayer.Character:FindFirstChild("Shirt Graphic") then | |
208 | game.Players.LocalPlayer.Character["Shirt Graphic"]:remove() | |
209 | end | |
210 | if game.Players.LocalPlayer.Character:FindFirstChild("Shirt") then | |
211 | game.Players.LocalPlayer.Character["Shirt"]:remove() | |
212 | end | |
213 | if game.Players.LocalPlayer.Character:FindFirstChild("Pants") then | |
214 | game.Players.LocalPlayer.Character["Pants"]:remove() | |
215 | end | |
216 | for i=1,5 do | |
217 | wait() | |
218 | for _,hat in pairs(game.Players.LocalPlayer.Character:GetChildren()) do | |
219 | if hat.ClassName == "Accessory" then | |
220 | hat:remove() | |
221 | end | |
222 | if hat:IsA("BasePart") then | |
223 | hat.BrickColor = BrickColor.new("Pastel brown") | |
224 | end | |
225 | end | |
226 | end | |
227 | game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0 | |
228 | game.Players.LocalPlayer.Character.Humanoid.JumpPower = 0 | |
229 | ||
230 | ||
231 | Basepart = Instance.new("Part") | |
232 | ||
233 | ||
234 | Baseparticle = Instance.new("ParticleEmitter") | |
235 | Basemesh = Instance.new("SpecialMesh") | |
236 | local mesh = Basemesh:Clone() | |
237 | mesh.Parent = hair | |
238 | mesh.MeshId = "rbxassetid://1143041061" | |
239 | Baseweld = Instance.new("Weld") | |
240 | local weld = Baseweld:Clone() | |
241 | weld.Part0 = hair | |
242 | weld.Part1 = game.Players.LocalPlayer.Character.Head | |
243 | hair.Color = Color3.fromRGB(153, 125, 61) | |
244 | weld.C0 = CFrame.new(0,-0.25,0)*CFrame.Angles(0,math.rad(180),0) | |
245 | weld.Parent = hair | |
246 | ||
247 | shirt = Instance.new("Shirt",game.Players.LocalPlayer.Character) | |
248 | shirt.ShirtTemplate = "rbxassetid://804894303" | |
249 | pants = Instance.new("Pants",game.Players.LocalPlayer.Character) | |
250 | pants.PantsTemplate = "rbxassetid://189943600" | |
251 | ||
252 | game.Players.LocalPlayer.Character.Head.face.Texture = "http://www.roblox.com/asset/?id=1142979747" | |
253 | ||
254 | wait(1) | |
255 | game:GetService("Chat"):Chat(game.Players.LocalPlayer.Character.Head, "This can go two ways punk", "Green") | |
256 | wait(3) | |
257 | game:GetService("Chat"):Chat(game.Players.LocalPlayer.Character.Head, "You walk away", "Green") | |
258 | wait(3) | |
259 | game:GetService("Chat"):Chat(game.Players.LocalPlayer.Character.Head, "Or I walk in your, face.", "Green") | |
260 | wait(3) | |
261 | ||
262 | local counter = 0 | |
263 | ||
264 | for i=1,200 do | |
265 | wait() | |
266 | counter = counter+1 | |
267 | if counter > 2 then | |
268 | counter = 0 | |
269 | local part = Basepart:Clone() | |
270 | part.Color = Color3.fromRGB(255,175,0) | |
271 | part.Shape = Enum.PartType.Cylinder | |
272 | part.Anchored = true | |
273 | part.CanCollide = false | |
274 | part.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))) | |
275 | part.Parent = game.Workspace | |
276 | part.Material = Enum.Material.Neon | |
277 | part.Size = Vector3.new(1000000000,6,6) | |
278 | ||
279 | game:GetService("Debris"):AddItem(part,1) | |
280 | table.insert(degrowingList,part) | |
281 | local part = Basepart:Clone() | |
282 | part.Color = Color3.fromRGB(255,175,0) | |
283 | part.Shape = Enum.PartType.Ball | |
284 | part.Anchored = true | |
285 | part.CanCollide = false | |
286 | part.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame | |
287 | part.Parent = game.Workspace | |
288 | part.Material = Enum.Material.Neon | |
289 | part.Size = Vector3.new(1,1,1) | |
290 | game:GetService("Debris"):AddItem(part,3) | |
291 | table.insert(growingList,part) | |
292 | ||
293 | end | |
294 | for _,player in pairs(game.Workspace:GetChildren()) do | |
295 | if player:FindFirstChild("Humanoid") then | |
296 | player.Humanoid.CameraOffset = Vector3.new(math.random(-2,2),math.random(-2,2),0) | |
297 | end | |
298 | end | |
299 | ||
300 | end | |
301 | ||
302 | counter = counter+1 | |
303 | for _,player in pairs(game.Workspace:GetChildren()) do | |
304 | if player:FindFirstChild("Humanoid") then | |
305 | player.Humanoid.CameraOffset = Vector3.new(0,0,0) | |
306 | end | |
307 | ||
308 | ||
309 | end | |
310 | local colorlist = {ColorSequenceKeypoint.new(0,Color3.fromRGB(0,255,255)), | |
311 | ColorSequenceKeypoint.new(0.148,Color3.fromRGB(0,255,255)), | |
312 | ColorSequenceKeypoint.new(0.193,Color3.fromRGB(72,0,255)), | |
313 | ColorSequenceKeypoint.new(0.366,Color3.fromRGB(72,0,255)), | |
314 | ColorSequenceKeypoint.new(0.4,Color3.fromRGB(0,255,255)), | |
315 | ColorSequenceKeypoint.new(0.63,Color3.fromRGB(0,255,255)), | |
316 | ColorSequenceKeypoint.new(0.8,Color3.fromRGB(72,0,255)), | |
317 | ColorSequenceKeypoint.new(1,Color3.fromRGB(0,0,255)) | |
318 | } | |
319 | local uiParticle = Baseparticle:Clone() | |
320 | uiParticle.Color = ColorSequence.new(colorlist) | |
321 | uiParticle.LightEmission = 1 | |
322 | uiParticle.Size = NumberSequence.new(0.8) | |
323 | uiParticle.LockedToPart = true | |
324 | uiParticle.Texture = "rbxassetid://1143059159" | |
325 | local transparencylist = { NumberSequenceKeypoint.new(0,1), | |
326 | NumberSequenceKeypoint.new(0.5,0.67), | |
327 | NumberSequenceKeypoint.new(1,1) | |
328 | } | |
329 | ||
330 | uiParticle.Transparency = NumberSequence.new(transparencylist) | |
331 | uiParticle.ZOffset = -1 | |
332 | uiParticle.LockedToPart = true | |
333 | uiParticle.Lifetime = NumberRange.new(0.05,0.05) | |
334 | uiParticle.Speed = NumberRange.new(0,0) | |
335 | uiParticle.Rate = math.huge | |
336 | ||
337 | for _,hat in pairs(game.Players.LocalPlayer.Character:GetChildren()) do | |
338 | ||
339 | if hat:IsA("BasePart") then | |
340 | if hat.Name ~= "Head" and hat.Name ~= "HumanoidRootPart" then | |
341 | uiParticle:Clone().Parent = hat | |
342 | end | |
343 | end | |
344 | end | |
345 | ||
346 | ||
347 | ||
348 | beforesong:Stop() | |
349 | mainsong = Basesong:Clone() | |
350 | mainsong.Parent = game.Players.LocalPlayer.Character | |
351 | mainsong.Looped = true | |
352 | mainsong.Volume = 3 | |
353 | mainsong.SoundId = "rbxassetid://1106602456" | |
354 | mainsong:Play() | |
355 | ||
356 | game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 80 | |
357 | game.Players.LocalPlayer.Character.Humanoid.JumpPower = 150 | |
358 | game.Players.LocalPlayer.Character.Humanoid.Name = "LolFakeHumanoid" | |
359 | ||
360 | afterimages = {} | |
361 | ||
362 | game.Players.LocalPlayer.Character.Head.face:Clone().Parent = headd | |
363 | ||
364 | game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key) | |
365 | ||
366 | end) | |
367 | amcounter = 0 | |
368 | ||
369 | local PhysicsService = game:GetService("PhysicsService") | |
370 | ||
371 | ||
372 | ||
373 | ||
374 | for _,part in pairs(game.Players.LocalPlayer.Character:GetChildren()) do | |
375 | if part:FindFirstChild("ParticleEmitter") then | |
376 | part.ParticleEmitter.Enabled = false | |
377 | end | |
378 | if part:IsA("BasePart") then | |
379 | part.Transparency = 1 | |
380 | end | |
381 | end | |
382 | game.Players.LocalPlayer.Character.Head.face.Transparency = 1 | |
383 | ||
384 | ||
385 | ||
386 | game:GetService("RunService").RenderStepped:connect(function() | |
387 | for _,image in pairs(afterimages) do | |
388 | for _,part in pairs(image:GetChildren()) do | |
389 | if part:IsA("BasePart") then | |
390 | part.Transparency = part.Transparency+0.1 | |
391 | if part:FindFirstChild("face") then | |
392 | part.face.Transparency = part.face.Transparency+0.1 | |
393 | end | |
394 | if part.Transparency > 0.9 then | |
395 | image:remove() | |
396 | end | |
397 | end | |
398 | end | |
399 | end | |
400 | ||
401 | local image = Instance.new("Model",game.Workspace) | |
402 | image.Name = "AfterImage" | |
403 | ||
404 | local head = headd:Clone() | |
405 | head.CFrame = game.Players.LocalPlayer.Character.Head.CFrame | |
406 | local hairc = hair:Clone() | |
407 | head.Anchored = true | |
408 | head.Transparency = 0 | |
409 | head.face.Transparency = 0 | |
410 | hairc.Transparency = 0 | |
411 | hairc.Anchored = true | |
412 | hairc.Weld:remove() | |
413 | head.Parent = image | |
414 | hairc.Parent = image | |
415 | local torsoc = torso:Clone() | |
416 | torsoc.Parent = image | |
417 | torsoc.CFrame = game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.Angles(0,math.rad(-180),0) | |
418 | local armc = arm:Clone() | |
419 | armc.Parent = image | |
420 | armc.CFrame = game.Players.LocalPlayer.Character["Right Arm"].CFrame*CFrame.Angles(0,math.rad(180),0) | |
421 | local armc = arm:Clone() | |
422 | armc.Parent = image | |
423 | armc.CFrame = game.Players.LocalPlayer.Character["Left Arm"].CFrame*CFrame.Angles(0,math.rad(180),0) | |
424 | local legc = leg1:Clone() | |
425 | legc.Parent = image | |
426 | legc.CFrame = game.Players.LocalPlayer.Character["Left Leg"].CFrame*CFrame.Angles(0,math.rad(-180),0) | |
427 | local legc = leg2:Clone() | |
428 | legc.Parent = image | |
429 | legc.CFrame = game.Players.LocalPlayer.Character["Right Leg"].CFrame*CFrame.Angles(0,math.rad(-180),0) | |
430 | ||
431 | table.insert(afterimages,image) | |
432 | ||
433 | game.Players.LocalPlayer.Character.Parent = game.Workspace.CurrentCamera | |
434 | end) |