View difference between Paste ID: 6AgDjZCk and TQ04JJZv
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 print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
6
--[[ last updated: 2018/5/13, 15:30
7
8
Pen by oilsauce.]]
9
10
print("Pen Script by Oilsauce.")
11
print("Click: Stab")
12
print("E: Toggle Pen")
13
print("F: Throw Pen")
14
15
-----------------------------------------------------------------------------------
16
17
local plrs = game:GetService("Players")
18
local plr = plrs.LocalPlayer
19
local char = plr.Character
20
local tweenserv = game:GetService("TweenService")
21
local lighting = game:GetService("Lighting")
22
local hum = char:FindFirstChildOfClass("Humanoid")
23
local mou = plr:GetMouse()
24
local tor = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
25
local root = char:FindFirstChild("HumanoidRootPart")
26
local head = char:FindFirstChild("Head")
27
local face = head:FindFirstChildOfClass("Decal")
28
local larm = char:FindFirstChild("Left Arm") or char:FindFirstChild("LeftUpperArm")
29
local rarm = char:FindFirstChild("Right Arm") or char:FindFirstChild("RightUpperArm")
30
local rleg = char:FindFirstChild("Right Leg") or char:FindFirstChild("RightUpperLeg")
31
local lleg = char:FindFirstChild("Left Leg") or char:FindFirstChild("LeftUpperLeg")
32
local neck = tor:FindFirstChild("Neck")
33
local rootj = root:FindFirstChild("RootJoint")
34
local LS = tor:FindFirstChild("Left Shoulder")
35
local RS = tor:FindFirstChild("Right Shoulder")
36
local LH = tor:FindFirstChild("Left Hip")
37
local RH = tor:FindFirstChild("Right Hip")
38
local bp = plr:FindFirstChild("Backpack")
39
40
hum:ClearAllChildren()
41
char.Animate:remove()
42
43
44
--Converted with ttyyuu12345's model to script plugin v4
45
function sandbox(var,func)
46
	local env = getfenv(func)
47
	local newenv = setmetatable({},{
48
		__index = function(self,k)
49
			if k=="script" then
50
				return var
51
			else
52
				return env[k]
53
			end
54
		end,
55
	})
56
	setfenv(func,newenv)
57
	return func
58
end
59
cors = {}
60
mas = Instance.new("Model",game:GetService("Lighting"))
61
Model0 = Instance.new("Model")
62
Part1 = Instance.new("Part")
63
Part2 = Instance.new("Part")
64
ManualWeld3 = Instance.new("ManualWeld")
65
Part4 = Instance.new("Part")
66
ManualWeld5 = Instance.new("ManualWeld")
67
Part6 = Instance.new("Part")
68
ManualWeld7 = Instance.new("ManualWeld")
69
Part8 = Instance.new("Part")
70
ManualWeld9 = Instance.new("ManualWeld")
71
Part10 = Instance.new("Part")
72
ManualWeld11 = Instance.new("ManualWeld")
73
Part12 = Instance.new("Part")
74
ManualWeld13 = Instance.new("ManualWeld")
75
Model0.Name = "pen"
76
Model0.Parent = mas
77
Part1.Name = "handler2"
78
Part1.Parent = Model0
79
Part1.Material = Enum.Material.Glass
80
Part1.BrickColor = BrickColor.new("Really black")
81
Part1.Shape = Enum.PartType.Cylinder
82
Part1.Size = Vector3.new(0.099999927, 0.075000003, 0.075000003)
83
Part1.CFrame = CFrame.new(0.422837317, 4.01673937, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
84
Part1.BottomSurface = Enum.SurfaceType.Smooth
85
Part1.TopSurface = Enum.SurfaceType.Smooth
86
Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
87
Part1.Position = Vector3.new(0.422837317, 4.01673937, 24.1206856)
88
Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
89
Part2.Name = "handler1"
90
Part2.Parent = Model0
91
Part2.Material = Enum.Material.Glass
92
Part2.BrickColor = BrickColor.new("Really black")
93
Part2.Shape = Enum.PartType.Cylinder
94
Part2.Size = Vector3.new(0.099999927, 0.100000001, 0.100000001)
95
Part2.CFrame = CFrame.new(0.356837302, 4.02223921, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
96
Part2.BottomSurface = Enum.SurfaceType.Smooth
97
Part2.TopSurface = Enum.SurfaceType.Smooth
98
Part2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
99
Part2.Position = Vector3.new(0.356837302, 4.02223921, 24.1206856)
100
Part2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
101
ManualWeld3.Name = "Weld"
102
ManualWeld3.Parent = Part2
103
ManualWeld3.C1 = CFrame.new(-0.0660000145, 0.00549983978, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
104
ManualWeld3.Part0 = Part2
105
ManualWeld3.Part1 = Part1
106
Part4.Name = "body"
107
Part4.Parent = Model0
108
Part4.Material = Enum.Material.Glass
109
Part4.BrickColor = BrickColor.new("Really black")
110
Part4.Shape = Enum.PartType.Cylinder
111
Part4.Size = Vector3.new(1.27499998, 0.125, 0.125)
112
Part4.CFrame = CFrame.new(-0.320662677, 4.02673912, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
113
Part4.BottomSurface = Enum.SurfaceType.Smooth
114
Part4.TopSurface = Enum.SurfaceType.Smooth
115
Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
116
Part4.Position = Vector3.new(-0.320662677, 4.02673912, 24.1206856)
117
Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
118
ManualWeld5.Name = "Weld"
119
ManualWeld5.Parent = Part4
120
ManualWeld5.C1 = CFrame.new(-0.743499994, 0.00999975204, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
121
ManualWeld5.Part0 = Part4
122
ManualWeld5.Part1 = Part1
123
Part6.Name = "clipholder"
124
Part6.Parent = Model0
125
Part6.Material = Enum.Material.Glass
126
Part6.BrickColor = BrickColor.new("Really black")
127
Part6.Shape = Enum.PartType.Cylinder
128
Part6.Size = Vector3.new(0.2, 0.150000006, 0.150000006)
129
Part6.CFrame = CFrame.new(-0.986662686, 4.02623892, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
130
Part6.BottomSurface = Enum.SurfaceType.Smooth
131
Part6.TopSurface = Enum.SurfaceType.Smooth
132
Part6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
133
Part6.Position = Vector3.new(-0.986662686, 4.02623892, 24.1206856)
134
Part6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
135
ManualWeld7.Name = "Weld"
136
ManualWeld7.Parent = Part6
137
ManualWeld7.C1 = CFrame.new(-1.4095, 0.00949954987, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
138
ManualWeld7.Part0 = Part6
139
ManualWeld7.Part1 = Part1
140
Part8.Name = "clip"
141
Part8.Parent = Model0
142
Part8.Material = Enum.Material.Glass
143
Part8.BrickColor = BrickColor.new("Really black")
144
Part8.Size = Vector3.new(0.724999905, 0.0500000119, 0.100000001)
145
Part8.CFrame = CFrame.new(-0.663956106, 4.10453987, 24.1179676, 1, 0, 0, 0, 1, 0, 0, 0, 1)
146
Part8.BottomSurface = Enum.SurfaceType.Smooth
147
Part8.TopSurface = Enum.SurfaceType.Smooth
148
Part8.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
149
Part8.Position = Vector3.new(-0.663956106, 4.10453987, 24.1179676)
150
Part8.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
151
ManualWeld9.Name = "Weld"
152
ManualWeld9.Parent = Part8
153
ManualWeld9.C1 = CFrame.new(-1.08679342, 0.0878005028, -0.0027179718, 1, 0, 0, 0, 1, 0, 0, 0, 1)
154
ManualWeld9.Part0 = Part8
155
ManualWeld9.Part1 = Part1
156
Part10.Name = "button"
157
Part10.Parent = Model0
158
Part10.Material = Enum.Material.Glass
159
Part10.BrickColor = BrickColor.new("Dark indigo")
160
Part10.Shape = Enum.PartType.Cylinder
161
Part10.Size = Vector3.new(0.14, 0.125, 0.125)
162
Part10.CFrame = CFrame.new(-1.09316278, 4.02473927, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
163
Part10.BottomSurface = Enum.SurfaceType.Smooth
164
Part10.TopSurface = Enum.SurfaceType.Smooth
165
Part10.Color = Color3.new(0.239216, 0.0823529, 0.521569)
166
Part10.Position = Vector3.new(-1.09316278, 4.02473927, 24.1206856)
167
Part10.Color = Color3.new(0.239216, 0.0823529, 0.521569)
168
ManualWeld11.Name = "Weld"
169
ManualWeld11.Parent = Part10
170
ManualWeld11.C1 = CFrame.new(-1.51600003, 0.007999897, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
171
ManualWeld11.Part0 = Part10
172
ManualWeld11.Part1 = Part1
173
Part12.Name = "sharp"
174
Part12.Parent = Model0
175
Part12.Material = Enum.Material.Glass
176
Part12.Shape = Enum.PartType.Cylinder
177
Part12.Size = Vector3.new(0.099999927, 0.0500000007, 0.0500000007)
178
Part12.CFrame = CFrame.new(0.484837323, 4.01723957, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
179
Part12.BottomSurface = Enum.SurfaceType.Smooth
180
Part12.TopSurface = Enum.SurfaceType.Smooth
181
Part12.Position = Vector3.new(0.484837323, 4.01723957, 24.1206856)
182
ManualWeld13.Name = "Weld"
183
ManualWeld13.Parent = Part12
184
ManualWeld13.C1 = CFrame.new(0.0620000064, 0.000500202179, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
185
ManualWeld13.Part0 = Part12
186
ManualWeld13.Part1 = Part1
187
for i,v in pairs(mas:GetChildren()) do
188
	v.Parent = char
189
	pen = v
190
	body = Part4
191
	button = Part10
192
	pcall(function() v:MakeJoints() end)
193
end
194
mas:Destroy()
195
for i,v in pairs(cors) do
196
	spawn(function()
197
		pcall(v)
198
	end)
199
end
200
201
local rootj0 = rootj.C0
202
local neck0 = neck.C0
203
local LS0 = LS.C0
204
local RS0 = RS.C0
205
local LH0 = LH.C0
206
local RH0 = RH.C0
207
local rootj1 = rootj.C1
208
local neck1 = neck.C1
209
local LS1 = LS.C1
210
local RS1 = RS.C1
211
local LH1 = LH.C1
212
local RH1 = RH.C1
213
214
-----------------------------------------------------------------------------------
215
216
local CFn = CFrame.new
217
local CFa = CFrame.Angles
218
local Rad = math.rad
219
local Sin = math.sin
220
local Cos = math.cos
221
local sine = 1
222
223
local penp = Instance.new("Part", char)
224
penp.Size = Vector3.new(1, 1, 1)
225
penp.CanCollide = false
226
penp.Transparency = 1
227
local penpw = Instance.new("Weld", penp)
228
penpw.Part0 = rarm
229
penpw.Part1 = penp
230
penpw.C1 = CFn(0, -1, 0) * CFa(0, 0, Rad(180))
231
local penpw0 = penpw.C0
232
local penpw1 = penpw.C1
233
234
local penw = Instance.new("Weld", body)
235
penw.Name = "penWeld22"
236
penw.Part0 = penp
237
penw.Part1 = body
238
penw.C1 = CFa(0, 0, Rad(180))
239
local penw0 = penw.C0
240
local penw1 = penw.C1
241
242
local sharpw = ManualWeld13
243
local sharpw0 = ManualWeld13.C0
244
local sharpw1 = ManualWeld13.C1
245
local sharpw02 = CFn(0.3, 0, 0)
246
sharpw.C0 = sharpw02
247
248
local botw = ManualWeld11
249
local botw0 = ManualWeld11.C0
250
local botw1 = ManualWeld11.C1
251
local botw02 = CFn(-0.07, 0, 0)
252
botw.C0 = botw0
253
254
-----------------------------------------------------------------------------------
255
256
local ws = 16
257
local jp = 50
258
local out = false
259
local ouch = false
260
local hitok = false
261
local canattack = true
262
local stabstate = 1
263
local Stabbing = false
264
local Throwing = false
265
local rot = 1
266
local dmg = 5
267
268
-----------------------------------------------------------------------------------
269
270
ArtificialHB = Instance.new("BindableEvent", script)
271
ArtificialHB.Name = "Heartbeat"
272
script:WaitForChild("Heartbeat")
273
274
frame = 1 / 60
275
tf = 0
276
allowframeloss = false
277
tossremainder = false
278
279
280
lastframe = tick()
281
script.Heartbeat:Fire()
282
283
284
game:GetService("RunService").Heartbeat:connect(function(s, p)
285
	tf = tf + s
286
	if tf >= frame then
287
		if allowframeloss then
288
			script.Heartbeat:Fire()
289
			lastframe = tick()
290
		else
291
			for i = 1, math.floor(tf / frame) do
292
				script.Heartbeat:Fire()
293
			end
294
			lastframe = tick()
295
		end
296
		if tossremainder then
297
			tf = 0
298
		else
299
			tf = tf - frame * math.floor(tf / frame)
300
		end
301
	end
302
end)
303
304
function swait(num)
305
	if num == 0 or num == nil then
306
		game:service("RunService").Stepped:wait(0)
307
	else
308
		for i = 0, num do
309
			game:service("RunService").Stepped:wait(0)
310
		end
311
	end
312
end
313
314
function clerp(a, b, t)
315
	return a:lerp(b, t)
316
end
317
318
function ToggleSharp()
319
	if not button:FindFirstChild("Penclickit360") then
320
		local clickso = Instance.new("Sound", button)
321
		clickso.SoundId = "rbxassetid://537744814"
322
		clickso.Name = "Penclickit360"
323
		clickso.Volume = 5
324
		clickso:Play()
325
	else
326
		local clickso = button:FindFirstChild("Penclickit360")
327
		clickso:Play()
328
	end
329
	if out == false then
330
		sharpw.C0 = sharpw0
331
		botw.C0 = botw02
332
		dmg = 30
333
		out = true
334
	else
335
		sharpw.C0 = sharpw02
336
		botw.C0 = botw0
337
		dmg = 5
338
		out = false
339
	end
340
end
341
342
function Stab()
343
	if stabstate == 1 and canattack == true then
344
		Stabbing = true
345
		canattack = false
346
		stabstate = 2
347
		hum.WalkSpeed = 3
348
		hum.JumpPower = 7
349
		hitok = true
350
		body.Touched:connect(function(hit)
351
			if hitok == true and not hit:IsDescendantOf(char) and hit.Parent:FindFirstChildOfClass("Humanoid") then
352
				hitok = false
353
				local owdude = hit.Parent
354
				local owhum = owdude:FindFirstChildOfClass("Humanoid")
355
				owhum.Health = owhum.Health - dmg
356
				if out == true then
357
					local bloodsound = Instance.new("Sound", hit)
358
					bloodsound.Volume = 10
359
					bloodsound.SoundId = "rbxassetid://180083298"
360
					bloodsound:Play()
361
					game:GetService("Debris"):AddItem(bloodsound, 1)
362
					local bloodsplash = Instance.new("ParticleEmitter", hit)
363
					bloodsplash.Lifetime = NumberRange.new(0.7, 1)
364
					bloodsplash.Speed = NumberRange.new(6)
365
					bloodsplash.SpreadAngle = Vector2.new(-360, 360)
366
					bloodsplash.Rate = 1000
367
					bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
368
					bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
369
					bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
370
					bloodsplash.Texture = "rbxassetid://771221224"
371
					game:GetService("Debris"):AddItem(bloodsplash, 1)
372
					wait(0.25)
373
					bloodsplash.Enabled = false
374
				end
375
			end
376
			if hitok == true and not hit:IsDescendantOf(char) and hit.Parent.Parent:FindFirstChildOfClass("Humanoid") then
377
				hitok = false
378
				local owdude = hit.Parent.Parent
379
				local owhum = owdude:FindFirstChildOfClass("Humanoid")
380
				owhum.Health = owhum.Health - dmg
381
				if out == true then
382
					local bloodsound = Instance.new("Sound", hit)
383
					bloodsound.Volume = 10
384
					bloodsound.SoundId = "rbxassetid://180083298"
385
					bloodsound:Play()
386
					game:GetService("Debris"):AddItem(bloodsound, 1)
387
					local bloodsplash = Instance.new("ParticleEmitter", hit)
388
					bloodsplash.Lifetime = NumberRange.new(0.7, 1)
389
					bloodsplash.Speed = NumberRange.new(6)
390
					bloodsplash.SpreadAngle = Vector2.new(-360, 360)
391
					bloodsplash.Rate = 1000
392
					bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
393
					bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
394
					bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
395
					bloodsplash.Texture = "rbxassetid://771221224"
396
					game:GetService("Debris"):AddItem(bloodsplash, 1)
397
					wait(0.25)
398
					bloodsplash.Enabled = false
399
				end
400
			end
401
		end)
402
		for i = 0,1,.15 do
403
			penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i)
404
			neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
405
			rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
406
			LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
407
			RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(-30), Rad(-30), Rad(-3)), i)
408
			LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
409
			RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
410
			LS.C0 = clerp(LS.C0, LS0, i)
411
			RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(150)), i)
412
			LH.C0 = clerp(LH.C0, LH0, i)
413
			RH.C0 = clerp(RH.C0, RH0, i)
414
			swait()
415
		end
416
		for i = 0,1,.15 do
417
			penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i)
418
			neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
419
			rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
420
			LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
421
			RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(20), Rad(-30), Rad(-3)), i)
422
			LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
423
			RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
424
			LS.C0 = clerp(LS.C0, LS0, i)
425
			RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(20)), i)
426
			LH.C0 = clerp(LH.C0, LH0, i)
427
			RH.C0 = clerp(RH.C0, RH0, i)
428
			swait()
429
		end
430
		hitok = false
431
		hum.WalkSpeed = ws
432
		hum.JumpPower = jp
433
		canattack = true
434
		Stabbing = false
435
	elseif stabstate == 2 and canattack == true then
436
		canattack = false
437
		stabstate = 1
438
		hum.WalkSpeed = 3
439
		hum.JumpPower = 7
440
		hitok = true
441
		body.Touched:connect(function(hit)
442
			if hitok == true and not hit:IsDescendantOf(char) and hit.Parent:FindFirstChildOfClass("Humanoid") then
443
				local owdude = hit.Parent
444
				local owhum = owdude:FindFirstChildOfClass("Humanoid")
445
				owhum.Health = owhum.Health - dmg
446
				if out == true then
447
					local bloodsound = Instance.new("Sound", hit)
448
					bloodsound.Volume = 10
449
					bloodsound.SoundId = "rbxassetid://180083298"
450
					bloodsound:Play()
451
					game:GetService("Debris"):AddItem(bloodsound, 1)
452
					local bloodsplash = Instance.new("ParticleEmitter", hit)
453
					bloodsplash.Lifetime = NumberRange.new(0.7, 1)
454
					bloodsplash.Speed = NumberRange.new(6)
455
					bloodsplash.SpreadAngle = Vector2.new(-360, 360)
456
					bloodsplash.Rate = 1000
457
					bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
458
					bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
459
					bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
460
					bloodsplash.Texture = "rbxassetid://771221224"
461
					game:GetService("Debris"):AddItem(bloodsplash, 1)
462
					wait(0.25)
463
					bloodsplash.Enabled = false
464
				end
465
			end
466
			if hitok == true and not hit:IsDescendantOf(char) and hit.Parent.Parent:FindFirstChildOfClass("Humanoid") then
467
				hitok = false
468
				local owdude = hit.Parent.Parent
469
				local owhum = owdude:FindFirstChildOfClass("Humanoid")
470
				owhum.Health = owhum.Health - dmg
471
				if out == true then
472
					local bloodsound = Instance.new("Sound", hit)
473
					bloodsound.Volume = 10
474
					bloodsound.SoundId = "rbxassetid://180083298"
475
					bloodsound:Play()
476
					game:GetService("Debris"):AddItem(bloodsound, 1)
477
					local bloodsplash = Instance.new("ParticleEmitter", hit)
478
					bloodsplash.Lifetime = NumberRange.new(0.7, 1)
479
					bloodsplash.Speed = NumberRange.new(6)
480
					bloodsplash.SpreadAngle = Vector2.new(-360, 360)
481
					bloodsplash.Rate = 1000
482
					bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
483
					bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
484
					bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
485
					bloodsplash.Texture = "rbxassetid://771221224"
486
					game:GetService("Debris"):AddItem(bloodsplash, 1)
487
					wait(0.25)
488
					bloodsplash.Enabled = false
489
				end
490
			end
491
		end)
492
		for i = 0,1,.15 do
493
			penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i)
494
			neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
495
			rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
496
			LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
497
			RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(30), Rad(30), Rad(-3)), i)
498
			LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
499
			RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
500
			LS.C0 = clerp(LS.C0, LS0, i)
501
			RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(150)), i)
502
			LH.C0 = clerp(LH.C0, LH0, i)
503
			RH.C0 = clerp(RH.C0, RH0, i)
504
			swait()
505
		end
506
		for i = 0,1,.15 do
507
			penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i)
508
			neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
509
			rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
510
			LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
511
			RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(-20), Rad(30), Rad(-3)), i)
512
			LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
513
			RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
514
			LS.C0 = clerp(LS.C0, LS0, i)
515
			RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(20)), i)
516
			LH.C0 = clerp(LH.C0, LH0, i)
517
			RH.C0 = clerp(RH.C0, RH0, i)
518
			swait()
519
		end
520
		hitok = false
521
		hum.WalkSpeed = ws
522
		hum.JumpPower = jp
523
		canattack = true
524
		Stabbing = false
525
	end
526
end
527
528
function Throw()
529
	if canattack == true then
530
		Throwing = true
531
		canattack = false
532
		hum.WalkSpeed = 3
533
		hum.JumpPower = 7
534
		ouch = true
535
		for i = 0,1,.15 do
536
			penw.C1 = clerp(penw.C1, penw1 * CFa(0, 0, Rad(-90)), i)
537
			neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
538
			rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
539
			LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
540
			RS.C1 = clerp(RS.C1, RS1 * CFa(0, Rad(-30), Rad(-3)), i)
541
			LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
542
			RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
543
			LS.C0 = clerp(LS.C0, LS0, i)
544
			RS.C0 = clerp(RS.C0, RS0 * CFa(0, Rad(90), Rad(90)), i)
545
			LH.C0 = clerp(LH.C0, LH0, i)
546
			RH.C0 = clerp(RH.C0, RH0, i)
547
			swait()
548
		end
549
		local throwpen = pen:Clone()
550
		for i,v in pairs(throwpen:GetChildren()) do
551
			if v:IsA("BasePart") and v.CanCollide == true then
552
				v.CanCollide = false
553
			end
554
		end
555
		throwpen.Parent = workspace
556
		local throwbod = throwpen:FindFirstChild("body")
557
		if throwbod:FindFirstChild("penWeld22") then
558
			throwbod:FindFirstChild("penWeld22"):Destroy()
559
		end
560
		local throwbv = Instance.new("BodyVelocity", throwbod)
561
		throwbv.Velocity = mou.Hit.lookVector * 100
562
		throwbv.MaxForce = Vector3.new(100000000000000000, 100000000000000000, 100000000000000000)
563
		throwbod.Touched:connect(function(hit)
564
			if ouch == true and not hit:IsDescendantOf(char) then
565
				ouch = false
566
				throwpen:Destroy()
567
				if hit.Parent:FindFirstChildOfClass("Humanoid") then
568
					local throwhum = hit.Parent:FindFirstChildOfClass("Humanoid")
569
					throwhum.Health = throwhum.Health - dmg
570
					if out == true then
571
						local bloodsound = Instance.new("Sound", hit)
572
						bloodsound.Volume = 10
573
						bloodsound.SoundId = "rbxassetid://180083286"
574
						bloodsound:Play()
575
						game:GetService("Debris"):AddItem(bloodsound, 1)
576
						local bloodsplash = Instance.new("ParticleEmitter", hit)
577
						bloodsplash.Lifetime = NumberRange.new(0.7, 1)
578
						bloodsplash.Speed = NumberRange.new(6)
579
						bloodsplash.SpreadAngle = Vector2.new(-360, 360)
580
						bloodsplash.Rate = 1000
581
						bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
582
						bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
583
						bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
584
						bloodsplash.Texture = "rbxassetid://771221224"
585
						game:GetService("Debris"):AddItem(bloodsplash, 1)
586
						wait(0.25)
587
						bloodsplash.Enabled = false
588
					end
589
				end
590
				if hit.Parent.Parent:FindFirstChildOfClass("Humanoid") then
591
					local throwhum = hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
592
					throwhum.Health = throwhum.Health - dmg
593
					if out == true then
594
						local bloodsound = Instance.new("Sound", hit)
595
						bloodsound.Volume = 10
596
						bloodsound.SoundId = "rbxassetid://180083286"
597
						bloodsound:Play()
598
						game:GetService("Debris"):AddItem(bloodsound, 1)
599
						local bloodsplash = Instance.new("ParticleEmitter", hit)
600
						bloodsplash.Lifetime = NumberRange.new(0.7, 1)
601
						bloodsplash.Speed = NumberRange.new(6)
602
						bloodsplash.SpreadAngle = Vector2.new(-360, 360)
603
						bloodsplash.Rate = 1000
604
						bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
605
						bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
606
						bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
607
						bloodsplash.Texture = "rbxassetid://771221224"
608
						game:GetService("Debris"):AddItem(bloodsplash, 1)
609
						wait(0.25)
610
						bloodsplash.Enabled = false
611
					end
612
				end
613
			end
614
		end)
615
		for i,v in pairs(pen:GetChildren()) do
616
			if v:IsA("BasePart") then
617
				v.Transparency = 1
618
			end
619
		end
620
		for i = 0,1,.1 do
621
			penw.C1 = clerp(penw.C1, penw1 * CFa(0, 0, Rad(-90)), i)
622
			neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
623
			rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025) * CFa(Rad(-20), 0, 0), i)
624
			LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
625
			RS.C1 = clerp(RS.C1, RS1 * CFa(0, Rad(-30), Rad(-3)), i)
626
			LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), Rad(-20)), i)
627
			RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), Rad(-20)), i)
628
			LS.C0 = clerp(LS.C0, LS0, i)
629
			RS.C0 = clerp(RS.C0, RS0 * CFa(0, Rad(-80), Rad(90)), i)
630
			LH.C0 = clerp(LH.C0, LH0, i)
631
			RH.C0 = clerp(RH.C0, RH0, i)
632
			swait()
633
		end
634
		for i = 0,1,.1 do
635
			penw.C1 = clerp(penw.C1, penw1 * CFa(0, 0, Rad(-90)), i)
636
			neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-30), 0, 0), i)
637
			rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025) * CFa(0, 0, Rad(-30)), i)
638
			LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
639
			RS.C1 = clerp(RS.C1, RS1 * CFa(0, Rad(-30), Rad(-3)), i)
640
			LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(35), 0), i)
641
			RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(35), 0), i)
642
			LS.C0 = clerp(LS.C0, LS0, i)
643
			RS.C0 = clerp(RS.C0, RS0 * CFn(0, 0, -0.5) * CFa(0, Rad(90), Rad(30)), i)
644
			LH.C0 = clerp(LH.C0, LH0, i)
645
			RH.C0 = clerp(RH.C0, RH0, i)
646
			swait()
647
		end
648
		for i,v in pairs(pen:GetChildren()) do
649
			if v:IsA("BasePart") then
650
				v.Transparency = 0
651
			end
652
		end
653
		hum.WalkSpeed = ws
654
		hum.JumpPower = jp
655
		canattack = true
656
		Throwing = false
657
	end
658
end
659
660
-----------------------------------------------------------------------------------
661
662
function kdown(k)
663
	if k == "e" then
664
		ToggleSharp()
665
	elseif k == "f" then
666
		Throw()
667
	end
668
end
669
670
mou.KeyDown:connect(kdown)
671
mou.Button1Down:connect(Stab)
672
673
-----------------------------------------------------------------------------------
674
675
while true do
676
	swait()
677
	sine = sine + 1
678
	rot = rot + 25
679
	if rot == 360 then
680
		rot = 1
681
	end
682
	local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
683
	if Stabbing == true then
684
		state = "Stabbing"
685
	elseif Throwing == true then
686
		state = "Throwing"
687
	elseif 1 < root.Velocity.y then
688
		state = "Jump"
689
	elseif -1 > root.Velocity.y then
690
		state = "Fall"
691
	elseif torvel < 1 then
692
		state = "Idle"
693
	elseif tor.Velocity.magnitude < 50 then
694
		state = "Walk"
695
	end
696
	if state == "Jump" then
697
		penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), 0.15)
698
		neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), 0.15)
699
		rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(-15), 0, 0), 0.15)
700
		LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), 0.15)
701
		RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(10), 0, 0), 0.15)
702
		LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.2, 0) * CFa(Rad(2), 0, Rad(-15)), 0.15)
703
		RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.5, 0) * CFa(Rad(2), 0, Rad(15)), 0.15)
704
		LS.C0 = clerp(LS.C0, LS0, 0.15)
705
		RS.C0 = clerp(RS.C0, RS0, 0.15)
706
		LH.C0 = clerp(LH.C0, LH0 * CFn(-0.2, 0, 0), 0.15)
707
		RH.C0 = clerp(RH.C0, RH0 * CFn(0.5, 0, 0), 0.15)
708
	elseif state == "Fall" then
709
		penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), 0.15)
710
		neck.C1 = clerp(neck.C1, neck1 * CFa(0, 0, 0), 0.15)
711
		rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(15), 0, 0), 0.15)
712
		LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(35), 0, 0), 0.15)
713
		RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(35), 0, 0), 0.15)
714
		LH.C1 = clerp(LH.C1, LH1 * CFn(0.2, -0.2, -0.1) * CFa(Rad(15), 0, Rad(10)), 0.15)
715
		RH.C1 = clerp(RH.C1, RH1 * CFn(-0.2, -0.2, -0.1) * CFa(Rad(15), 0, Rad(-10)), 0.15)
716
		LS.C0 = clerp(LS.C0, LS0, 0.15)
717
		RS.C0 = clerp(RS.C0, RS0, 0.15)
718
		LH.C0 = clerp(LH.C0, LH0 * CFa(0, 0, Rad(-20)), 0.15)
719
		RH.C0 = clerp(RH.C0, RH0 * CFa(0, 0, Rad(20)), 0.15)
720
	elseif state == "Idle" then
721
		penw.C1 = clerp(penw.C1, penw1 * CFn(0, 0, 0.5) * CFa(0, 0, Rad(rot)), 0.15)
722
		neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2 * Cos(sine / 15)), 0, 0), 0.15)
723
		rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025 * Cos(sine / 15)), 0.15)
724
		LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), 0.15)
725
		RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(2), 0, Rad(-3 * Cos(sine / 15))), 0.15)
726
		LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025 * Cos(sine / 15), 0) * CFa(Rad(5), Rad(-5), 0), 0.15)
727
		RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025 * Cos(sine / 15), 0) * CFa(Rad(5), Rad(5), 0), 0.15)
728
		LS.C0 = clerp(LS.C0, LS0, 0.15)
729
		RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(80)), 0.15)
730
		LH.C0 = clerp(LH.C0, LH0, 0.15)
731
		RH.C0 = clerp(RH.C0, RH0, 0.15)
732
	elseif state == "Walk" then
733
		penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), 0.15)
734
		neck.C1 = clerp(neck.C1, neck1 *  CFa(Rad(-5), 0, 0), 0.15)
735
		rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0.1 * Cos(sine /3), 0.1 * Cos(sine /3)) * CFa(Rad(-5), 0, Rad(5 * Cos(sine / 6))), 0.15)
736
		LS.C1 = clerp(LS.C1, LS1 * CFa(0, 0, Rad(-50 * Cos(sine / 6))), 0.15)
737
		RS.C1 = clerp(RS.C1, RS1 * CFa(0, 0, Rad(-50 * Cos(sine / 6))), 0.15)
738
		LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(2), Rad(-5), Rad(50 * Cos(sine / 6))), 0.15)
739
		RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(2), Rad(5), Rad(50 * Cos(sine / 6))), 0.15)
740
		LS.C0 = clerp(LS.C0, LS0, 0.15)
741
		RS.C0 = clerp(RS.C0, RS0, 0.15)
742
		LH.C0 = clerp(LH.C0, LH0, 0.15)
743
		RH.C0 = clerp(RH.C0, RH0, 0.15)
744
	end
745
end