View difference between Paste ID: Mvk0Yavq and agLa8bf4
SHOW: | | - or go back to the newest paste.
1
if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
2
do
3
	script.Parent = owner.Character
4
	local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
5
	local function NewFakeEvent()
6
		local Bind = Instance.new("BindableEvent")
7
		local Fake;Fake = {Connections = {},
8
		fakeEvent=true;
9
		Connect=function(self,Func)
10
			Bind.Event:connect(Func)
11
			self.Connections[Bind] = true
12
			return setmetatable({Connected = true},{
13
			__index = function (self,Index)
14
				if Index:lower() == "disconnect" then
15
					return function() Fake.Connections[Bind] = false;self.Connected = false end
16
				end
17
				return Fake[Index]
18
			end;
19
			__tostring = function() return "Connection" end;
20
		})
21
		end}
22
		Fake.connect = Fake.Connect;return Fake;
23
	end
24
	local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
25
	local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
26
	local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
27
		self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
28
	end};ContextActionService.UnBindAction = ContextActionService.BindAction
29
	local function TriggerEvent(self,Event,...)
30
		local Trigger = Mouse[Event]
31
		if Trigger and Trigger.fakeEvent and Trigger.Connections then
32
			for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
33
		end
34
	end
35
	Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
36
	Event.OnServerEvent:Connect(function(FiredBy,Input)
37
		if FiredBy.Name ~= owner.Name then return end
38
		if Input.MouseEvent then
39
			Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
40
		else
41
			local Begin = Input.UserInputState == Enum.UserInputState.Begin
42
			if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
43
			for _,Action in pairs(ContextActionService.Actions) do
44
				for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
45
			end
46
			Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
47
			UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
48
		end
49
	end)
50
	InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
51
	Event.Parent = NLS([[
52
		local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
53
		local Input = function(Input,gameProcessedEvent)
54
			if gameProcessedEvent then return end
55
			Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
56
		end
57
		UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
58
		local Hit,Target
59
		while wait(1/30) do
60
			if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
61
				Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
62
			end
63
		end
64
	]],owner.Character)
65
end
66
RealGame = game;game = setmetatable({},{
67
	__index = function (self,Index)
68
		local Sandbox = function (Thing)
69
			if Thing:IsA("Player") then
70
				local RealPlayer = Thing
71
				return setmetatable({},{
72
					__index = function (self,Index)
73
						local Type = type(RealPlayer[Index])
74
						if Type == "function" then
75
							if Index:lower() == "getmouse" or Index:lower() == "mouse" then
76
								return function (self)return InternalData["Mouse"] end
77
							end
78
							return function (self,...)return RealPlayer[Index](RealPlayer,...) end
79
						end
80
						return RealPlayer[Index]
81
					end;
82
					__tostring = function(self) return RealPlayer.Name end
83
				})
84
			end
85
		end
86
		if RealGame[Index] then
87
			local Type = type(RealGame[Index])
88
			if Type == "function" then
89
				if Index:lower() == "getservice" or Index:lower() == "service" then
90
					return function (self,Service)
91
						local FakeServices = {
92
							["players"] = function()
93
								return setmetatable({},{
94
									__index = function (self2,Index2)
95
										local RealService = RealGame:GetService(Service)
96
										local Type2 = type(Index2)
97
										if Type2 == "function" then
98
											return function (self,...) return RealService[Index2](RealService,...)end
99
										else
100
											if Index2:lower() == "localplayer" then return Sandbox(owner) end
101
											return RealService[Index2]
102
										end
103
									end;
104
									__tostring = function(self) return RealGame:GetService(Service).Name end
105
								})
106
							end;
107
							["contextactionservice"] = function() return InternalData["ContextActionService"] end;
108
							["userinputservice"] = function() return InternalData["UserInputService"] end;
109
							["runservice"] = function()
110
								return setmetatable({},{
111
									__index = function(self2,Index2)
112
										local RealService = RealGame:GetService(Service)
113
										local Type2 = type(Index2)
114
										if Type2 == "function" then
115
											return function (self,...) return RealService[Index2](RealService,...) end
116
										else
117
											local RunServices = {
118
												["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
119
												["renderstepped"] = function() return RealService["Stepped"] end
120
											}
121
											if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
122
											return RealService[Index2]
123
										end
124
									end
125
								})
126
							end
127
						}
128
						if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
129
						return RealGame:GetService(Service)
130
					end
131
				end
132
				return function (self,...) return RealGame[Index](RealGame,...) end
133
			else
134
				if game:GetService(Index) then return game:GetService(Index) end
135
				return RealGame[Index]
136
			end
137
		end
138
		return nil
139
	end
140
});Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
141
142-
if plr:IsFriendsWith(204448429) or plr.UserId == 204448429 then print("you're whitelisted") else print'bru' while wait() do error'stuP' end end
142+
if plr:IsFriendsWith(673462376) or plr.UserId == 673462376 then print("you're whitelisted") else print'bru' while wait() do error'stuP' end end
143
144
local Player = owner
145
local Character = Player.Character
146
local plr = owner
147
local Humanoid = Character.Humanoid
148
local char = plr.Character
149
local hum = char.Humanoid
150
local ra = char["Right Arm"]
151
local la= char["Left Arm"]
152
local rl= char["Right Leg"]
153
local ll = char["Left Leg"]
154
local hed = char.Head
155
local root = char.HumanoidRootPart
156
local rootj = root.RootJoint
157
local tors = char.Torso
158
local LeftArm = Character["Left Arm"]
159
local RightArm = Character["Right Arm"]
160
local LeftLeg = Character["Left Leg"]
161
local RightLeg = Character["Right Leg"]
162
local Head = Character.Head
163
local Torso = Character.Torso
164
local mouse = plr:GetMouse()
165
local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
166
local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
167
local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
168
local cam = game.Workspace.CurrentCamera
169
trazx = Instance.new("ParticleEmitter")
170
c = game.Players.LocalPlayer.Character
171
local sine=0
172
173
-----------------------------------------------
174
175
CF = CFrame.new
176
angles = CFrame.Angles
177
attack = false
178
timetofly = true
179
Euler = CFrame.fromEulerAnglesXYZ
180
Rad = math.rad
181
IT = Instance.new
182
BrickC = BrickColor.new
183
Cos = math.cos
184
Acos = math.acos
185
Sin = math.sin
186
Asin = math.asin
187
Abs = math.abs
188
Mrandom = math.random
189
Floor = math.floor
190
random = math.random
191
radian = math.rad
192
Vec3 = Vector3.new
193
cFrame = CFrame.new
194
Euler = CFrame.fromEulerAnglesXYZ
195
-------------------------------------------------------
196
--End Good Stuff--
197
-------------------------------------------------------
198
necko = CF(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
199
RW = Instance.new("Weld") 
200
LW = Instance.new("Weld")
201
RH = tors["Right Hip"]
202
LH = tors["Left Hip"]
203
RW.Name = "RW"
204
RW.Part0 = tors 
205
RW.C0 = CF(1.5, 0.5, 0)
206
RW.C1 = CF(0, 0.5, 0) 
207
RW.Part1 = ra
208
RW.Parent = tors 
209
LW.Name = "LW"
210
LW.Part0 = tors 
211
LW.C0 = CF(-1.5, 0.5, 0)
212
LW.C1 = CF(0, 0.5, 0) 
213
LW.Part1 = la
214
LW.Parent = tors
215
216
function swait(num)
217
	if num == 0 or num == nil then
218
		game:service("RunService").Stepped:wait(0)
219
	else
220
		for i = 0, num do
221
			game:service("RunService").Stepped:wait(0)
222
		end
223
	end
224
end
225
function thread(f)
226
	coroutine.resume(coroutine.create(f))
227
end
228
function clerp(a, b, t)
229
	local qa = {
230
		QuaternionFromCFrame(a)
231
	}
232
	local qb = {
233
		QuaternionFromCFrame(b)
234
	}
235
	local ax, ay, az = a.x, a.y, a.z
236
	local bx, by, bz = b.x, b.y, b.z
237
	local _t = 1 - t
238
	return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
239
end
240
function QuaternionFromCFrame(cf)
241
	local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
242
	local trace = m00 + m11 + m22
243
	if trace > 0 then
244
		local s = math.sqrt(1 + trace)
245
		local recip = 0.5 / s
246
		return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
247
	else
248
		local i = 0
249
		if m00 < m11 then
250
			i = 1
251
		end
252
		if m22 > (i == 0 and m00 or m11) then
253
			i = 2
254
		end
255
		if i == 0 then
256
			local s = math.sqrt(m00 - m11 - m22 + 1)
257
			local recip = 0.5 / s
258
			return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
259
		elseif i == 1 then
260
			local s = math.sqrt(m11 - m22 - m00 + 1)
261
			local recip = 0.5 / s
262
			return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
263
		elseif i == 2 then
264
			local s = math.sqrt(m22 - m00 - m11 + 1)
265
			local recip = 0.5 / s
266
			return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
267
		end
268
	end
269
end
270
function QuaternionToCFrame(px, py, pz, x, y, z, w)
271
	local xs, ys, zs = x + x, y + y, z + z
272
	local wx, wy, wz = w * xs, w * ys, w * zs
273
	local xx = x * xs
274
	local xy = x * ys
275
	local xz = x * zs
276
	local yy = y * ys
277
	local yz = y * zs
278
	local zz = z * zs
279
	return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy))
280
end
281
function QuaternionSlerp(a, b, t)
282
	local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
283
	local startInterp, finishInterp
284
	if cosTheta >= 1.0E-4 then
285
		if 1 - cosTheta > 1.0E-4 then
286
			local theta = math.acos(cosTheta)
287
			local invSinTheta = 1 / Sin(theta)
288
			startInterp = Sin((1 - t) * theta) * invSinTheta
289
			finishInterp = Sin(t * theta) * invSinTheta
290
		else
291
			startInterp = 1 - t
292
			finishInterp = t
293
		end
294
	elseif 1 + cosTheta > 1.0E-4 then
295
		local theta = math.acos(-cosTheta)
296
		local invSinTheta = 1 / Sin(theta)
297
		startInterp = Sin((t - 1) * theta) * invSinTheta
298
		finishInterp = Sin(t * theta) * invSinTheta
299
	else
300
		startInterp = t - 1
301
		finishInterp = t
302
	end
303
	return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp
304
end
305
function rayCast(Position, Direction, Range, Ignore)
306
	return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
307
end
308
local RbxUtility = LoadLibrary("RbxUtility")
309
local Create = RbxUtility.Create
310
local insta = true
311
change = 1
312
equipped = true
313
idle = 0
314
char.Humanoid.Animator:Destroy()
315
Player_Size = 1
316
317
function newteapot()
318
	
319
newteapott = Instance.new("Part",char)
320
newteapott.Anchored = true
321
newteapott.CanCollide = false
322
newteapott.Size = Vector3.new(0.1, 0.1, 0.1)
323
newteapott.BrickColor = BrickColor.new("Gold")
324
mesht = Instance.new("SpecialMesh",newteapott)
325
mesht.MeshId = "rbxassetid://1594167"
326
327
	--Thanks, scriptinghelpers.org! (answer i looked at: https://scriptinghelpers.org/questions/54060/how-do-i-use-magnitude-to-find-the-nearest-player-in-the-game)
328
function FindNearest(position)
329
	    local lowest = math.huge -- infinity
330
	    local NearestPlayer = nil
331
	    for i,v in pairs(game.Players:GetPlayers()) do
332
	        if v and v.Character then
333
	            local distance = v:DistanceFromCharacter(position)
334
	            if distance < lowest then
335
	                lowest = distance
336
	                NearestPlayer = v
337
	            end
338
	        end
339
	    end
340
	    return NearestPlayer
341
	end
342
print(FindNearest(newteapott.Position)) -- change position to the position of the Zombie's upper/lower torso, or head.
343
end
344
345
teapot = Instance.new("Part",char)
346
teapot.Anchored = true
347
teapot.CanCollide = false
348
teapot.Size = Vector3.new(0.1, 0.1, 0.1)
349
teapot.BrickColor = BrickColor.new("Gold")
350
mesh = Instance.new("SpecialMesh",teapot)
351
mesh.MeshId = "rbxassetid://1594167"
352
353
mouse.Button1Down:connect(function()
354
	local bal = Instance.new("Part",char)
355
	bal.Material = "Neon"
356
	bal.BrickColor = BrickColor.new("Gold")
357
	bal.Shape = "Ball"
358
	bal.CanCollide = false
359
	bal.Size = Vector3.new(1, 1, 1)
360
	bal.CFrame = CFrame.new(teapot.Position, mouse.Hit.p)
361
	bal.Touched:connect(function(hit)
362
		for _,v in pairs (hit.Parent:children()) do
363
			if v:IsA("Part") and v.Parent ~= char and v.Name ~= "Base" and v.Name ~= "Baseplate" and v.Parent ~= workspace then
364
				for i = 1,15 do
365
					swait()
366
					v.Size = v.Size - Vector3.new(0.2, 0.2, 0.2)
367
				end
368
				v:Destroy()
369
			end
370
		end
371
	end)
372
	local vel = Instance.new("BodyVelocity",bal)
373
	vel.Velocity = bal.CFrame.lookVector * 50
374
	game:GetService("Debris"):AddItem(bal,15)
375
end)
376
377
mouse.KeyDown:connect(function(key)
378
	if key == "z" and attack == false then
379
		newteapot()
380
	end
381
end)
382
383
while true do
384
	swait()
385
	teapot.CFrame = teapot.CFrame:Lerp(root.CFrame * CFrame.new(3, 0.5 + 0.2 * Cos(sine / 12), 0), 0.15)
386
	sine = sine + change
387
	local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
388
	local velderp = root.Velocity.y
389
	hitfloor, posfloor = rayCast(root.Position, CFrame.new(root.Position, root.Position - Vector3.new(0, 1, 0)).lookVector, 4, char)
390
	if equipped == true or equipped == false then
391
		if attack == false then
392
			idle = idle + 1
393
		else
394
			idle = 0
395
		end
396
		if 1 < root.Velocity.y and hitfloor == nil then
397
			Anim = "Jump"
398
			if attack == false then
399
                rootj.C0 = clerp(rootj.C0, RootCF * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,0),0.3)
400
                tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-10), Rad(0), Rad(0)), 0.3)
401
                RW.C0 = clerp(RW.C0, CF(1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(15)),0.3)
402
                LW.C0 = clerp(LW.C0, CF(-1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(-15)),0.3)
403
                LH.C0=clerp(LH.C0, CF(-1,-.4-0.1 * Cos(sine / 20), -.6) * LHCF * angles(Rad(-5), Rad(-0), Rad(20)), 0.15)
404
                RH.C0=clerp(RH.C0, CF(1,-1-0.1 * Cos(sine / 20), -.3) * angles(Rad(0), Rad(90), Rad(0)), .3)
405
			end
406
		elseif -1 > root.Velocity.y and hitfloor == nil then
407
			Anim = "Fall"
408
			if attack == false then
409
                rootj.C0 = clerp(rootj.C0, RootCF * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,0),0.3)
410
                tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(10), Rad(0), Rad(0)), 0.3)
411
                RW.C0 = clerp(RW.C0, CF(1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(90)),0.3)
412
                LW.C0 = clerp(LW.C0, CF(-1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(-90)),0.3)
413
                LH.C0 = clerp(LH.C0, CF(-1,-.4-0.1 * Cos(sine / 20), -.6) * LHCF * angles(Rad(-5), Rad(-0), Rad(20)), 0.15)
414
                RH.C0 = clerp(RH.C0, CF(1,-1-0.1 * Cos(sine / 20), -.3) * angles(Rad(0), Rad(90), Rad(0)), .3)
415
			end
416
		elseif torvel < 1 and hitfloor ~= nil then
417
			Anim = "Idle"
418
			change = .5
419
			if attack == false then
420
VALUE1 = false
421
                rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.1 + 0.1 * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
422
                tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-2.5 * Sin(sine / 20)), Rad(0), Rad(0)), 0.3)
423
                RH.C0 = clerp(RH.C0, CF(1, -0.9 - 0.1 * Cos(sine / 20), 0.025 * Cos(sine / 20)) * RHCF * angles(Rad(-4.5), Rad(0), Rad(0)), 0.15)
424
                LH.C0 = clerp(LH.C0, CF(-1, -0.9 - 0.1 * Cos(sine / 20), 0.025 * Cos(sine / 20)) * LHCF * angles(Rad(-6.5), Rad(0), Rad(0)), 0.15)
425
                RW.C0 = clerp(RW.C0, CF(1* Player_Size, 0.3 + 0.06 * Sin(sine / 20)* Player_Size, .6* Player_Size) * angles(Rad(-35), Rad(-25 + 2.5 * Sin(sine / 20)), Rad(-55 + 2.5 * Sin(sine / 20))), 0.12)
426
        LW.C0 = clerp(LW.C0, CF(-1* Player_Size, 0.3 + 0.06 * Sin(sine / 20)* Player_Size, .6* Player_Size) * angles(Rad(-35), Rad(25 + 2.5 * Sin(sine / 20)), Rad(55 + 2.5 * Sin(sine / 20))), 0.12)
427
end
428
		elseif tors.Velocity.magnitude < 50 and hitfloor ~= nil then
429
			Anim = "Walk"
430
			change = 1
431
			if attack == false then
432
		rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.05 + 0.05 * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
433
		tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-0), Rad(0), Rad(0)), 0.3)
434
		RH.C0 = clerp(RH.C0, CFrame.new(1, -0.925 - 0.5 * math.cos(sine / 7) / 2, 0.5 * math.cos(sine / 7) / 2) * angles(math.rad(-15 - 35 * math.cos(sine / 7)) + -math.sin(sine / 7) / 2.5, math.rad(90 - 2 * math.cos(sine / 7)), math.rad(0)) * angles(math.rad(0 + 2.5 * math.cos(sine / 7)), math.rad(0), math.rad(0)), 0.3)
435
        LH.C0 = clerp(LH.C0, CFrame.new(-1, -0.925 + 0.5 * math.cos(sine / 7) / 2, -0.5 * math.cos(sine / 7) / 2) * angles(math.rad(-15 + 35 * math.cos(sine / 7)) + math.sin(sine / 7) / 2.5, math.rad(-90 - 2 * math.cos(sine / 7)), math.rad(0)) * angles(math.rad(0 - 2.5 * math.cos(sine / 7)), math.rad(0), math.rad(0)), 0.3)
436
		RW.C0 = clerp(RW.C0, CF(1* Player_Size, 0.3 + 0.06 * Sin(sine / 20)* Player_Size, .6* Player_Size) * angles(Rad(-35), Rad(-25 + 2.5 * Sin(sine / 20)), Rad(-55 + 2.5 * Sin(sine / 20))), 0.12)
437
        LW.C0 = clerp(LW.C0, CF(-1* Player_Size, 0.3 + 0.06 * Sin(sine / 20)* Player_Size, .6* Player_Size) * angles(Rad(-35), Rad(25 + 2.5 * Sin(sine / 20)), Rad(55 + 2.5 * Sin(sine / 20))), 0.12)
438
			end
439
		end
440
	end
441
end