View difference between Paste ID: vHHTj03c 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+
143
local Character = Player.Character
144
local plr = owner
145
local Humanoid = Character.Humanoid
146
local char = plr.Character
147
local hum = char.Humanoid
148
local ra = char["Right Arm"]
149
local la= char["Left Arm"]
150
local rl= char["Right Leg"]
151
local ll = char["Left Leg"]
152
local hed = char.Head
153
local root = char.HumanoidRootPart
154
local rootj = root.RootJoint
155
local tors = char.Torso
156
local LeftArm = Character["Left Arm"]
157
local RightArm = Character["Right Arm"]
158
local LeftLeg = Character["Left Leg"]
159
local RightLeg = Character["Right Leg"]
160
local Head = Character.Head
161
local Torso = Character.Torso
162
local mouse = plr:GetMouse()
163
local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
164
local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
165
local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
166
local cam = game.Workspace.CurrentCamera
167
trazx = Instance.new("ParticleEmitter")
168
c = game.Players.LocalPlayer.Character
169
local sine=0
170
171
-----------------------------------------------
172
173
CF = CFrame.new
174
angles = CFrame.Angles
175
attack = false
176
timetofly = true
177
Euler = CFrame.fromEulerAnglesXYZ
178
Rad = math.rad
179
IT = Instance.new
180
BrickC = BrickColor.new
181
Cos = math.cos
182
Acos = math.acos
183
Sin = math.sin
184
Asin = math.asin
185
Abs = math.abs
186
Mrandom = math.random
187
Floor = math.floor
188
random = math.random
189
radian = math.rad
190
Vec3 = Vector3.new
191
cFrame = CFrame.new
192
Euler = CFrame.fromEulerAnglesXYZ
193
-------------------------------------------------------
194
--End Good Stuff--
195
-------------------------------------------------------
196
necko = CF(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
197
RW = Instance.new("Weld") 
198
LW = Instance.new("Weld")
199
RH = tors["Right Hip"]
200
LH = tors["Left Hip"]
201
RW.Name = "RW"
202
RW.Part0 = tors 
203
RW.C0 = CF(1.5, 0.5, 0)
204
RW.C1 = CF(0, 0.5, 0) 
205
RW.Part1 = ra
206
RW.Parent = tors 
207
LW.Name = "LW"
208
LW.Part0 = tors 
209
LW.C0 = CF(-1.5, 0.5, 0)
210
LW.C1 = CF(0, 0.5, 0) 
211
LW.Part1 = la
212
LW.Parent = tors
213
214
function swait(num)
215
	if num == 0 or num == nil then
216
		game:service("RunService").Stepped:wait(0)
217
	else
218
		for i = 0, num do
219
			game:service("RunService").Stepped:wait(0)
220
		end
221
	end
222
end
223
function thread(f)
224
	coroutine.resume(coroutine.create(f))
225
end
226
function clerp(a, b, t)
227
	local qa = {
228
		QuaternionFromCFrame(a)
229
	}
230
	local qb = {
231
		QuaternionFromCFrame(b)
232
	}
233
	local ax, ay, az = a.x, a.y, a.z
234
	local bx, by, bz = b.x, b.y, b.z
235
	local _t = 1 - t
236
	return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
237
end
238
function QuaternionFromCFrame(cf)
239
	local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
240
	local trace = m00 + m11 + m22
241
	if trace > 0 then
242
		local s = math.sqrt(1 + trace)
243
		local recip = 0.5 / s
244
		return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
245
	else
246
		local i = 0
247
		if m00 < m11 then
248
			i = 1
249
		end
250
		if m22 > (i == 0 and m00 or m11) then
251
			i = 2
252
		end
253
		if i == 0 then
254
			local s = math.sqrt(m00 - m11 - m22 + 1)
255
			local recip = 0.5 / s
256
			return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
257
		elseif i == 1 then
258
			local s = math.sqrt(m11 - m22 - m00 + 1)
259
			local recip = 0.5 / s
260
			return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
261
		elseif i == 2 then
262
			local s = math.sqrt(m22 - m00 - m11 + 1)
263
			local recip = 0.5 / s
264
			return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
265
		end
266
	end
267
end
268
function QuaternionToCFrame(px, py, pz, x, y, z, w)
269
	local xs, ys, zs = x + x, y + y, z + z
270
	local wx, wy, wz = w * xs, w * ys, w * zs
271
	local xx = x * xs
272
	local xy = x * ys
273
	local xz = x * zs
274
	local yy = y * ys
275
	local yz = y * zs
276
	local zz = z * zs
277
	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))
278
end
279
function QuaternionSlerp(a, b, t)
280
	local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
281
	local startInterp, finishInterp
282
	if cosTheta >= 1.0E-4 then
283
		if 1 - cosTheta > 1.0E-4 then
284
			local theta = math.acos(cosTheta)
285
			local invSinTheta = 1 / Sin(theta)
286
			startInterp = Sin((1 - t) * theta) * invSinTheta
287
			finishInterp = Sin(t * theta) * invSinTheta
288
		else
289
			startInterp = 1 - t
290
			finishInterp = t
291
		end
292
	elseif 1 + cosTheta > 1.0E-4 then
293
		local theta = math.acos(-cosTheta)
294
		local invSinTheta = 1 / Sin(theta)
295
		startInterp = Sin((t - 1) * theta) * invSinTheta
296
		finishInterp = Sin(t * theta) * invSinTheta
297
	else
298
		startInterp = t - 1
299
		finishInterp = t
300
	end
301
	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
302
end
303
function rayCast(Position, Direction, Range, Ignore)
304
	return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
305
end
306
local RbxUtility = LoadLibrary("RbxUtility")
307
local Create = RbxUtility.Create
308
local insta = true
309
change = 1
310
equipped = true
311
idle = 0
312
char.Humanoid.Animator:Destroy()
313
Player_Size = 1
314
315
function newteapot()
316
	
317
newteapott = Instance.new("Part",char)
318
newteapott.Anchored = true
319
newteapott.CanCollide = false
320
newteapott.Size = Vector3.new(0.1, 0.1, 0.1)
321
newteapott.BrickColor = BrickColor.new("Gold")
322
mesht = Instance.new("SpecialMesh",newteapott)
323
mesht.MeshId = "rbxassetid://1594167"
324
325
	--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)
326
function FindNearest(position)
327
	    local lowest = math.huge -- infinity
328
	    local NearestPlayer = nil
329
	    for i,v in pairs(game.Players:GetPlayers()) do
330
	        if v and v.Character then
331
	            local distance = v:DistanceFromCharacter(position)
332
	            if distance < lowest then
333
	                lowest = distance
334
	                NearestPlayer = v
335
	            end
336
	        end
337
	    end
338
	    return NearestPlayer
339
	end
340
print(FindNearest(newteapott.Position)) -- change position to the position of the Zombie's upper/lower torso, or head.
341
end
342
343
teapot = Instance.new("Part",char)
344
teapot.Anchored = true
345
teapot.CanCollide = false
346
teapot.Size = Vector3.new(0.1, 0.1, 0.1)
347
teapot.BrickColor = BrickColor.new("Gold")
348
mesh = Instance.new("SpecialMesh",teapot)
349
mesh.MeshId = "rbxassetid://1594167"
350
351
mouse.Button1Down:connect(function()
352
	local bal = Instance.new("Part",char)
353
	bal.Material = "Neon"
354
	bal.BrickColor = BrickColor.new("Gold")
355
	bal.Shape = "Ball"
356
	bal.CanCollide = false
357
	bal.Size = Vector3.new(1, 1, 1)
358
	bal.CFrame = CFrame.new(teapot.Position, mouse.Hit.p)
359
	bal.Touched:connect(function(hit)
360
		for _,v in pairs (hit.Parent:children()) do
361
			if v:IsA("Part") and v.Parent ~= char and v.Name ~= "Base" and v.Name ~= "Baseplate" and v.Parent ~= workspace then
362
				for i = 1,15 do
363
					swait()
364
					v.Size = v.Size - Vector3.new(0.2, 0.2, 0.2)
365
				end
366
				v:Destroy()
367
			end
368
		end
369
	end)
370
	local vel = Instance.new("BodyVelocity",bal)
371
	vel.Velocity = bal.CFrame.lookVector * 50
372
	game:GetService("Debris"):AddItem(bal,15)
373
end)
374
375
mouse.KeyDown:connect(function(key)
376
	if key == "z" and attack == false then
377
		newteapot()
378
	end
379
end)
380
381
while true do
382
	swait()
383
	teapot.CFrame = teapot.CFrame:Lerp(root.CFrame * CFrame.new(3, 0.5 + 0.2 * Cos(sine / 12), 0), 0.15)
384
	sine = sine + change
385
	local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
386
	local velderp = root.Velocity.y
387
	hitfloor, posfloor = rayCast(root.Position, CFrame.new(root.Position, root.Position - Vector3.new(0, 1, 0)).lookVector, 4, char)
388
	if equipped == true or equipped == false then
389
		if attack == false then
390
			idle = idle + 1
391
		else
392
			idle = 0
393
		end
394
		if 1 < root.Velocity.y and hitfloor == nil then
395
			Anim = "Jump"
396
			if attack == false then
397
                rootj.C0 = clerp(rootj.C0, RootCF * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,0),0.3)
398
                tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-10), Rad(0), Rad(0)), 0.3)
399
                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)
400
                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)
401
                LH.C0=clerp(LH.C0, CF(-1,-.4-0.1 * Cos(sine / 20), -.6) * LHCF * angles(Rad(-5), Rad(-0), Rad(20)), 0.15)
402
                RH.C0=clerp(RH.C0, CF(1,-1-0.1 * Cos(sine / 20), -.3) * angles(Rad(0), Rad(90), Rad(0)), .3)
403
			end
404
		elseif -1 > root.Velocity.y and hitfloor == nil then
405
			Anim = "Fall"
406
			if attack == false then
407
                rootj.C0 = clerp(rootj.C0, RootCF * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,0),0.3)
408
                tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(10), Rad(0), Rad(0)), 0.3)
409
                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)
410
                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)
411
                LH.C0 = clerp(LH.C0, CF(-1,-.4-0.1 * Cos(sine / 20), -.6) * LHCF * angles(Rad(-5), Rad(-0), Rad(20)), 0.15)
412
                RH.C0 = clerp(RH.C0, CF(1,-1-0.1 * Cos(sine / 20), -.3) * angles(Rad(0), Rad(90), Rad(0)), .3)
413
			end
414
		elseif torvel < 1 and hitfloor ~= nil then
415
			Anim = "Idle"
416
			change = .5
417
			if attack == false then
418
VALUE1 = false
419
                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)
420
                tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-2.5 * Sin(sine / 20)), Rad(0), Rad(0)), 0.3)
421
                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)
422
                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)
423
                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)
424
        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)
425
end
426
		elseif tors.Velocity.magnitude < 50 and hitfloor ~= nil then
427
			Anim = "Walk"
428
			change = 1
429
			if attack == false then
430
		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)
431
		tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-0), Rad(0), Rad(0)), 0.3)
432
		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)
433
        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)
434
		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)
435
        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)
436
			end
437
		end
438
	end
439
end