View difference between Paste ID: W5V7V5uh and Mc8hM9L1
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
wait(0.2)
154
155
--SEIZURE TIME!!! (By Rufus14)
156
mouse = game.Players.LocalPlayer:GetMouse()
157
game.Players.LocalPlayer.Character.Animate:destroy()
158
game.Chat:Chat(game.Players.LocalPlayer.Character.Head,"Fite me nubs. I has da powah of da memz.","Red")
159
Gun = Instance.new("Part", game.Players.LocalPlayer.Character["Right Arm"])
160
Gun.CanCollide = false
161
shot = Instance.new("Sound", Gun)
162
shot.SoundId = "rbxassetid://205561897"
163
shot.Volume = 50
164
Mesh = Instance.new("SpecialMesh", Gun)
165
Mesh.MeshId = "http://www.roblox.com/asset/?id=50763455"
166
Mesh.TextureId = "http://www.roblox.com/asset/?id=50763489"
167
Weld = Instance.new("Weld", Gun)
168
Weld.Part0 = Gun
169
Weld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
170
Weld.C0 = CFrame.Angles(3.1,0,0) * CFrame.new(0,1.5,0)
171
for i = 1,20 do
172
	wait()
173
	game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 * CFrame.Angles(0,0,-0.08)
174
	game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 * CFrame.Angles(0,0,0.08)
175
end
176
for i = 1,20 do
177
	wait()
178
	game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 * CFrame.Angles(0.06,0,0)
179
end
180
for i = 1,5 do
181
	wait()
182
	game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 * CFrame.new(0,-0.15,0.05)
183
end
184
shooting = false
185
function lol(key)
186
	key = key:lower()
187
	if not shooting then
188
	if key == "q" then
189
		shooting = true
190
		shot:Play()
191
		game.Chat:Chat(game.Players.LocalPlayer.Character.Head,"GARFIELD!!!","Red")
192
		local BOOM = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
193
		BOOM.SoundId = "rbxassetid://201858072"
194
		BOOM.Volume = 10
195
		BOOM:Play()
196
		local part = Instance.new("Part", workspace)
197
		part.Size = Vector3.new(0.4, 0.4, 0.4)
198
		part.BrickColor = BrickColor.new("Toothpaste")
199
		part.Position = Gun.Position
200
		part.Position = part.Position + Gun.CFrame.lookVector * 0
201
		part.Rotation = Gun.CFrame.lookVector * 10
202
		part.Position = part.Position - Vector3.new(0,0.3,0)
203
		local vel = Instance.new("BodyVelocity", part)
204
		vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
205
		vel.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * 200
206
			game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 * CFrame.Angles(0,0,-0.3)
207
		game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 * CFrame.Angles(0,0,0.3)
208
		wait(0.1)
209
		game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 * CFrame.Angles(0,0,0.3)
210
		game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 * CFrame.Angles(0,0,-0.3)
211
		shooting = false
212
		local function ded(ball)
213
			local Tors = ball.Parent:FindFirstChild("Torso")
214
			local hed = ball.Parent:FindFirstChild("Head")
215
			local hum = ball.Parent:FindFirstChild("Humanoid")
216
			local rootpart = ball.Parent:FindFirstChild("HumanoidRootPart")
217
			part:destroy()
218
			Tors["Left Shoulder"].C0 = Tors["Left Shoulder"].C0 * CFrame.Angles(0,0,math.random(-1,1))
219
			Tors["Right Shoulder"].C0 = Tors["Right Shoulder"].C0 * CFrame.Angles(0,0,math.random(-1,1))
220
            hum.PlatformStand = true
221
            local SEIZURETIME = Instance.new("Sound", Tors)
222
            SEIZURETIME.SoundId = "rbxassetid://156823872"
223
            SEIZURETIME.Looped = true
224
            SEIZURETIME:Play()
225
            SEIZURETIME.Volume = 50
226
            game.Chat:Chat(hed,"HALP MEH11!1!!","Red")
227
            local velocity = Instance.new("BodyVelocity", Tors)
228
            velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
229
            velocity.Velocity = Vector3.new(game.Players.LocalPlayer.Character.Torso.CFrame.lookVector,game.Players.LocalPlayer.Character.Torso.CFrame.lookVector ,game.Players.LocalPlayer.Character.Torso.CFrame.lookVector)
230
            velocity:destroy()
231
            print(hed.Parent.Name)
232
            rootpart.RootJoint.C0 = rootpart.RootJoint.C0 * CFrame.Angles(2,0,0)
233
            while true do
234
	            wait()
235
	            hum.CameraOffset = Vector3.new(math.random(-2,2),math.random(-2,2),math.random(-2,2))
236
	            game.Chat:Chat(hed,"HALP MEEEEH11!1!!","Red")
237
	            hum.Health = math.random(1,100)
238
	            Tors.Neck.C0 = Tors.Neck.C0 * CFrame.Angles(math.random(-1,1),0,0)
239
	            Tors["Left Hip"].C0 = Tors["Left Hip"].C0 * CFrame.Angles(0,0,math.random(-1,1))
240
			    Tors["Right Hip"].C0 = Tors["Right Hip"].C0 * CFrame.Angles(0,0,math.random(-1,1))
241
	            Tors["Left Shoulder"].C0 = Tors["Left Shoulder"].C0 * CFrame.Angles(0,0,math.random(-1,1))
242
			    Tors["Right Shoulder"].C0 = Tors["Right Shoulder"].C0 * CFrame.Angles(0,0,math.random(-1,1))
243
            end
244
		end
245
		part.Touched:connect(ded)
246
	end
247
	end
248
	end
249
mouse.KeyDown:connect(lol)
250
rig = game.Players.LocalPlayer.Character.Torso
251
run = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
252
run.SoundId = "rbxassetid://142665235"
253
run.Volume = 0
254
run.Looped = true
255
run:Play()
256
run.PlaybackSpeed = 1.2
257
walking = true
258
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25
259
function walk(key)
260
	key = key:lower()
261
	if key == "w" then
262
	walking = true
263
	run.Volume = 10
264
	if walking == true then
265
	wait()
266
	for i = 1,5 do
267
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
268
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
269
	end
270
	while walking == true do
271
	for i = 1,5 do
272
	wait()
273
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
274
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
275
	end
276
	for i = 1,5 do
277
	wait()
278
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
279
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
280
	end
281
	end
282
	end
283
	end
284
	end
285
mouse.KeyDown:connect(walk)
286
function notwalk(key)
287
	key = key:lower()
288
	if key == "w" then
289
		walking = false
290
		run.Volume = 0
291
		for i = 1,10 do
292
		wait()
293
		rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
294
        rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
295
		end
296
	end
297
end
298
mouse.KeyUp:connect(notwalk)
299
---------------------------------
300
walking1 = false
301
function walk1(key)
302
	key = key:lower()
303
	if key == "d" then
304
	walking1 = true
305
	if walking1 == true then
306
	wait()
307
	run.Volume = 10
308
	for i = 1,5 do
309
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
310
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
311
	end
312
	while walking1 == true do
313
	for i = 1,5 do
314
	wait()
315
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
316
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
317
	end
318
	for i = 1,5 do
319
	wait()
320
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
321
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
322
	end
323
	end
324
	end
325
	end
326
	end
327
mouse.KeyDown:connect(walk1)
328
function notwalk1(key)
329
	key = key:lower()
330
	if key == "d" then
331
		walking1 = false
332
		run.Volume = 0
333
		for i = 1,10 do
334
		wait()
335
		rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
336
        rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
337
		end
338
	end
339
end
340
mouse.KeyUp:connect(notwalk1)
341
------------------------------------------
342
walking2 = false
343
function walk2(key)
344
	key = key:lower()
345
	if key == "a" then
346
	walking2 = true
347
	run.Volume = 10
348
	if walking2 == true then
349
	wait()
350
	for i = 1,5 do
351
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
352
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
353
	end
354
	while walking2 == true do
355
	for i = 1,5 do
356
	wait()
357
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
358
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
359
	end
360
	for i = 1,5 do
361
	wait()
362
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
363
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
364
	end
365
	end
366
	end
367
	end
368
	end
369
mouse.KeyDown:connect(walk2)
370
function notwalk2(key)
371
	key = key:lower()
372
	if key == "a" then
373
		walking2 = false
374
		run.Volume = 0
375
		for i = 1,10 do
376
		wait()
377
		rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
378
        rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
379
		end
380
	end
381
end
382
mouse.KeyUp:connect(notwalk2)
383
----------------------------------------------------
384
walking3 = false
385
function walk3(key)
386
	key = key:lower()
387
	if key == "s" then
388
	walking3 = true
389
	run.Volume = 10
390
	if walking3 == true then
391
	wait()
392
	for i = 1,5 do
393
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
394
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
395
	end
396
	while walking3 == true do
397
	for i = 1,5 do
398
	wait()
399
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
400
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
401
	end
402
	for i = 1,5 do
403
	wait()
404
	rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
405
	rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
406
	end
407
	end
408
	end
409
	end
410
	end
411
mouse.KeyDown:connect(walk3)
412
function notwalk3(key)
413
	key = key:lower()
414
	if key == "s" then
415
		walking3 = false
416
		run.Volume = 0
417
		for i = 1,10 do
418
		wait()
419
		rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
420
        rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
421
		end
422
	end
423
end
424
mouse.KeyUp:connect(notwalk3)print("Hello world!")