View difference between Paste ID: rj8KZ9vZ and zngHimjA
SHOW: | | - or go back to the newest paste.
1
--By Rufus14
2
--Converted with ttyyuu12345's model to script plugin v4
3
function sandbox(var,func)
4
	local env = getfenv(func)
5
	local newenv = setmetatable({},{
6
		__index = function(self,k)
7
			if k=="script" then
8
				return var
9
			else
10
				return env[k]
11
			end
12
		end,
13
	})
14
	setfenv(func,newenv)
15
	return func
16
end
17
cors = {}
18
mas = Instance.new("Model",game:GetService("Lighting"))
19
Tool0 = Instance.new("Tool")
20
Script1 = Instance.new("Script")
21
Part2 = Instance.new("Part")
22
SpecialMesh3 = Instance.new("SpecialMesh")
23
Sound4 = Instance.new("Sound")
24
Sound5 = Instance.new("Sound")
25
Sound6 = Instance.new("Sound")
26
Trail7 = Instance.new("Trail")
27
Sound8 = Instance.new("Sound")
28
Tool0.Name = "Katana"
29
Tool0.Parent = mas
30
Tool0.TextureId = "http://www.roblox.com/asset/?id=11444089"
31
Tool0.Grip = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0)
32
Tool0.GripForward = Vector3.new(-1, -0, -0)
33
Tool0.GripPos = Vector3.new(0, 0, -1.70000005)
34
Tool0.GripRight = Vector3.new(0, 1, 0)
35
Tool0.GripUp = Vector3.new(0, 0, 1)
36
Script1.Parent = Tool0
37
table.insert(cors,sandbox(Script1,function()
38
--By Rufus14
39
canattack = true
40
cananimate = false
41
equipped = false
42
tool = script.Parent
43
handle = tool.Handle
44
equipsound = handle.Equip
45
swishsound = handle.Swoosh
46
blocksound = handle.Clang
47
stabsound = handle.Stab
48
owner = nil
49
character = nil
50
mouseclick = false
51
attacknumber = 1
52
trail = handle.Trail
53
runservice = game:GetService("RunService")
54
--
55
tool.Activated:connect(function()
56
	mouseclick = true
57
end)
58
tool.Deactivated:connect(function()
59
	mouseclick = false
60
end)
61
--
62
function ragdollkill(character)
63
	local victimshumanoid = character:findFirstChildOfClass("Humanoid")
64
	local checkragd = character:findFirstChild("ragded")
65
	if not checkragd then
66
		local boolvalue = Instance.new("BoolValue", character)
67
		boolvalue.Name = "ragded"
68
		if not character:findFirstChild("UpperTorso") then
69
			character.Archivable = true
70
			for i,v in pairs(character:GetChildren()) do
71
				if v.ClassName == "Sound" then
72
					v:remove()
73
				end
74
				for q,w in pairs(v:GetChildren()) do
75
					if w.ClassName == "Sound" then
76
						w:remove()
77
					end
78
				end
79
			end
80
			local ragdoll = character:Clone()
81
			for i,v in pairs(ragdoll:GetDescendants()) do
82
				if v.ClassName == "Motor" or v.ClassName == "Motor6D" then
83
					v:destroy()
84
				end
85
			end
86
			ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false
87
			ragdoll:findFirstChildOfClass("Humanoid").Health = 0
88
			if ragdoll:findFirstChild("Health") then
89
				if ragdoll:findFirstChild("Health").ClassName == "Script" then
90
					ragdoll:findFirstChild("Health").Disabled = true
91
				end
92
			end
93
			for i,v in pairs(character:GetChildren()) do
94
				if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" then
95
					v:destroy()
96
				end
97
			end
98
			for i,v in pairs(character:GetChildren()) do
99
				if v.ClassName == "Accessory" then
100
					local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
101
					if attachment1 then
102
						for q,w in pairs(character:GetChildren()) do
103
							if w.ClassName == "Part" then
104
								local attachment2 = w:findFirstChild(attachment1.Name)
105
								if attachment2 then
106
									local hinge = Instance.new("HingeConstraint", v.Handle)
107
									hinge.Attachment0 = attachment1
108
									hinge.Attachment1 = attachment2
109
									hinge.LimitsEnabled = true
110
									hinge.LowerAngle = 0
111
									hinge.UpperAngle = 0
112
								end
113
							end
114
						end
115
					end
116
				end
117
			end
118
			ragdoll.Parent = workspace
119
			if ragdoll:findFirstChild("Right Arm") then
120
				local glue = Instance.new("Glue", ragdoll.Torso)
121
				glue.Part0 = ragdoll.Torso
122
				glue.Part1 = ragdoll:findFirstChild("Right Arm")
123
				glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
124
				glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
125
				local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm"))
126
				limbcollider.Size = Vector3.new(10.40,10,10)
127
				limbcollider.Shape = "Cylinder"
128
				limbcollider.Transparency = 1
129
				limbcollider.Name = "LimbCollider"
130
				local limbcolliderweld = Instance.new("Weld", limbcollider)
131
				limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm")
132
				limbcolliderweld.Part1 = limbcollider
133
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
134
			end
135
			if ragdoll:findFirstChild("Left Arm") then
136
				local glue = Instance.new("Glue", ragdoll.Torso)
137
				glue.Part0 = ragdoll.Torso
138
				glue.Part1 = ragdoll:findFirstChild("Left Arm")
139
				glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
140
				glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
141
				local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm"))
142
				limbcollider.Size = Vector3.new(10.40,10,10)
143
				limbcollider.Shape = "Cylinder"
144
				limbcollider.Name = "LimbCollider"
145
				limbcollider.Transparency = 1
146
				local limbcolliderweld = Instance.new("Weld", limbcollider)
147
				limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm")
148
				limbcolliderweld.Part1 = limbcollider
149
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
150
			end
151
			if ragdoll:findFirstChild("Left Leg") then
152
				local glue = Instance.new("Glue", ragdoll.Torso)
153
				glue.Part0 = ragdoll.Torso
154
				glue.Part1 = ragdoll:findFirstChild("Left Leg")
155
				glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
156
				glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
157
				local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg"))
158
				limbcollider.Size = Vector3.new(10.40,10,10)
159
				limbcollider.Shape = "Cylinder"
160
				limbcollider.Name = "LimbCollider"
161
				limbcollider.Transparency = 0
162
				local limbcolliderweld = Instance.new("Weld", limbcollider)
163
				limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg")
164
				limbcolliderweld.Part1 = limbcollider
165
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
166
			end
167
			if ragdoll:findFirstChild("Right Leg") then
168
				local glue = Instance.new("Glue", ragdoll.Torso)
169
				glue.Part0 = ragdoll.Torso
170
				glue.Part1 = ragdoll:findFirstChild("Right Leg")
171
				glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
172
				glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
173
				local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg"))
174
				limbcollider.Size = Vector3.new(10.40,10,10)
175
				limbcollider.Shape = "Cylinder"
176
				limbcollider.Name = "LimbCollider"
177
				limbcollider.Transparency = 1
178
				local limbcolliderweld = Instance.new("Weld", limbcollider)
179
				limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg")
180
				limbcolliderweld.Part1 = limbcollider
181
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
182
			end
183
			if ragdoll:findFirstChild("Head") and ragdoll.Torso:findFirstChild("NeckAttachment") then
184
				local HeadAttachment = Instance.new("Attachment", ragdoll["Head"])
185
				HeadAttachment.Position = Vector3.new(0, -0.5, 0)
186
				local connection = Instance.new('HingeConstraint', ragdoll["Head"])
187
				connection.LimitsEnabled = true
188
				connection.Attachment0 = ragdoll.Torso.NeckAttachment
189
				connection.Attachment1 = HeadAttachment
190
				connection.UpperAngle = 60
191
				connection.LowerAngle = -60
192
			elseif ragdoll:findFirstChild("Head") and not ragdoll.Torso:findFirstChild("NeckAttachment") then
193
				local hedweld = Instance.new("Weld", ragdoll.Torso)
194
				hedweld.Part0 = ragdoll.Torso
195
				hedweld.Part1 = ragdoll.Head
196
				hedweld.C0 = CFrame.new(0,1.5,0)
197
			end
198-
			game.Debris:AddItem(ragdoll, 300)
198+
199
			local function aaaalol()
200
				wait(0.2)
201
				local function searchforvelocity(wot)
202
					for i,v in pairs(wot:GetChildren()) do
203
						searchforvelocity(v)
204
						if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then
205
							v:destroy()
206
						end
207
					end
208
				end
209
				searchforvelocity(ragdoll)
210
				wait(0.5)
211
				if ragdoll:findFirstChildOfClass("Humanoid") then
212
					ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
213
				end
214
				if ragdoll:findFirstChild("HumanoidRootPart") then
215
					ragdoll:findFirstChild("HumanoidRootPart"):destroy()
216
				end
217
			end
218
			spawn(aaaalol)
219
		elseif character:findFirstChild("UpperTorso") then
220
			character.Archivable = true
221
			for i,v in pairs(character:GetChildren()) do
222
				if v.ClassName == "Sound" then
223
					v:remove()
224
				end
225
				for q,w in pairs(v:GetChildren()) do
226
					if w.ClassName == "Sound" then
227
						w:remove()
228
					end
229
				end
230
			end
231
			local ragdoll = character:Clone()
232
			ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false
233
			for i,v in pairs(ragdoll:GetDescendants()) do
234
				if v.ClassName == "Motor" or v.ClassName == "Motor6D" then
235
					v:destroy()
236
				end
237
			end
238
			ragdoll:BreakJoints()
239
			ragdoll:findFirstChildOfClass("Humanoid").Health = 0
240
			if ragdoll:findFirstChild("Health") then
241
				if ragdoll:findFirstChild("Health").ClassName == "Script" then
242
					ragdoll:findFirstChild("Health").Disabled = true
243
				end
244
			end
245
			for i,v in pairs(character:GetChildren()) do
246
				if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" or v.ClassName == "MeshPart" then
247
					v:destroy()
248
				end
249
			end
250
			for i,v in pairs(character:GetChildren()) do
251
				if v.ClassName == "Accessory" then
252
					local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
253
					if attachment1 then
254
						for q,w in pairs(character:GetChildren()) do
255
							if w.ClassName == "Part" or w.ClassName == "MeshPart" then
256
								local attachment2 = w:findFirstChild(attachment1.Name)
257
								if attachment2 then
258
									local hinge = Instance.new("HingeConstraint", v.Handle)
259
									hinge.Attachment0 = attachment1
260
									hinge.Attachment1 = attachment2
261
									hinge.LimitsEnabled = true
262
									hinge.LowerAngle = 0
263
									hinge.UpperAngle = 0
264
								end
265
							end
266
						end
267
					end
268
				end
269
			end
270
			ragdoll.Parent = workspace
271
			local Humanoid = ragdoll:findFirstChildOfClass("Humanoid")
272
			Humanoid.PlatformStand = true
273
			local function makeballconnections(limb, attachementone, attachmenttwo, twistlower, twistupper)
274
				local connection = Instance.new('BallSocketConstraint', limb)
275
				connection.LimitsEnabled = true
276
				connection.Attachment0 = attachementone
277
				connection.Attachment1 = attachmenttwo
278
				connection.TwistLimitsEnabled = true
279
				connection.TwistLowerAngle = twistlower
280
				connection.TwistUpperAngle = twistupper
281
				local limbcollider = Instance.new("Part", limb)
282-
				limbcollider.Size = Vector3.new(10.1,10,10)
282+
				limbcollider.Size = Vector3.new(10.10,10,10)
283
				limbcollider.Shape = "Cylinder"
284
				limbcollider.Transparency = 1
285
				limbcollider:BreakJoints()
286
				local limbcolliderweld = Instance.new("Weld", limbcollider)
287
				limbcolliderweld.Part0 = limb
288
				limbcolliderweld.Part1 = limbcollider
289
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
290
			end
291
			local function makehingeconnections(limb, attachementone, attachmenttwo, lower, upper)
292
				local connection = Instance.new('HingeConstraint', limb)
293
				connection.LimitsEnabled = true
294
				connection.Attachment0 = attachementone
295
				connection.Attachment1 = attachmenttwo
296
				connection.LimitsEnabled = true
297
				connection.LowerAngle = lower
298
				connection.UpperAngle = upper
299
				local limbcollider = Instance.new("Part", limb)
300-
				limbcollider.Size = Vector3.new(10.1,10,10)
300+
				limbcollider.Size = Vector3.new(10.10,10,10)
301
				limbcollider.Shape = "Cylinder"
302
				limbcollider.Transparency = 1
303
				limbcollider:BreakJoints()
304
				local limbcolliderweld = Instance.new("Weld", limbcollider)
305
				limbcolliderweld.Part0 = limb
306
				limbcolliderweld.Part1 = limbcollider
307
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
308
			end
309
			local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head)
310
			HeadAttachment.Position = Vector3.new(0, -0.5, 0)
311
			if ragdoll.UpperTorso:findFirstChild("NeckAttachment") then
312
				makehingeconnections(Humanoid.Parent.Head, HeadAttachment, ragdoll.UpperTorso.NeckAttachment, -50, 50)
313
			end
314
			makehingeconnections(Humanoid.Parent.LowerTorso, Humanoid.Parent.LowerTorso.WaistRigAttachment, Humanoid.Parent.UpperTorso.WaistRigAttachment, -50, 50)
315
			makeballconnections(Humanoid.Parent.LeftUpperArm, Humanoid.Parent.LeftUpperArm.LeftShoulderRigAttachment, Humanoid.Parent.UpperTorso.LeftShoulderRigAttachment, -200, 200, 180)
316
			makehingeconnections(Humanoid.Parent.LeftLowerArm, Humanoid.Parent.LeftLowerArm.LeftElbowRigAttachment, Humanoid.Parent.LeftUpperArm.LeftElbowRigAttachment, 0, -60)
317
			makehingeconnections(Humanoid.Parent.LeftHand, Humanoid.Parent.LeftHand.LeftWristRigAttachment, Humanoid.Parent.LeftLowerArm.LeftWristRigAttachment, -20, 20)
318
			--
319
			makeballconnections(Humanoid.Parent.RightUpperArm, Humanoid.Parent.RightUpperArm.RightShoulderRigAttachment, Humanoid.Parent.UpperTorso.RightShoulderRigAttachment, -200, 200, 180)
320
			makehingeconnections(Humanoid.Parent.RightLowerArm, Humanoid.Parent.RightLowerArm.RightElbowRigAttachment, Humanoid.Parent.RightUpperArm.RightElbowRigAttachment, 0, -60)
321
			makehingeconnections(Humanoid.Parent.RightHand, Humanoid.Parent.RightHand.RightWristRigAttachment, Humanoid.Parent.RightLowerArm.RightWristRigAttachment, -20, 20)
322
			--
323
			makeballconnections(Humanoid.Parent.RightUpperLeg, Humanoid.Parent.RightUpperLeg.RightHipRigAttachment, Humanoid.Parent.LowerTorso.RightHipRigAttachment, -80, 80, 80)
324
			makehingeconnections(Humanoid.Parent.RightLowerLeg, Humanoid.Parent.RightLowerLeg.RightKneeRigAttachment, Humanoid.Parent.RightUpperLeg.RightKneeRigAttachment, 0, 60)
325
			makehingeconnections(Humanoid.Parent.RightFoot, Humanoid.Parent.RightFoot.RightAnkleRigAttachment, Humanoid.Parent.RightLowerLeg.RightAnkleRigAttachment, -20, 20)
326
			--
327
			makeballconnections(Humanoid.Parent.LeftUpperLeg, Humanoid.Parent.LeftUpperLeg.LeftHipRigAttachment, Humanoid.Parent.LowerTorso.LeftHipRigAttachment, -80, 80, 80)
328
			makehingeconnections(Humanoid.Parent.LeftLowerLeg, Humanoid.Parent.LeftLowerLeg.LeftKneeRigAttachment, Humanoid.Parent.LeftUpperLeg.LeftKneeRigAttachment, 0, 60)
329
			makehingeconnections(Humanoid.Parent.LeftFoot, Humanoid.Parent.LeftFoot.LeftAnkleRigAttachment, Humanoid.Parent.LeftLowerLeg.LeftAnkleRigAttachment, -20, 20)
330
			for i,v in pairs(Humanoid.Parent:GetChildren()) do
331
				if v.ClassName == "Accessory" then
332
					local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
333
					if attachment1 then
334
						for q,w in pairs(Humanoid.Parent:GetChildren()) do
335
							if w.ClassName == "Part" then
336
								local attachment2 = w:findFirstChild(attachment1.Name)
337
								if attachment2 then
338
									local hinge = Instance.new("HingeConstraint", v.Handle)
339
									hinge.Attachment0 = attachment1
340
									hinge.Attachment1 = attachment2
341
									hinge.LimitsEnabled = true
342
									hinge.LowerAngle = 0
343
									hinge.UpperAngle = 0
344
								end
345
							end
346
						end
347
					end
348
				end
349
			end
350
			for i,v in pairs(ragdoll:GetChildren()) do
351
				for q,w in pairs(v:GetChildren()) do
352
					if w.ClassName == "Motor6D"--[[ and w.Name ~= "Neck"--]] and w.Name ~= "ouch_weld" then
353
						w:destroy()
354
					end
355
				end
356
			end
357
			if ragdoll:findFirstChild("HumanoidRootPart") then
358
				ragdoll.HumanoidRootPart:destroy()
359
			end
360
			if ragdoll:findFirstChildOfClass("Humanoid") then
361
				ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
362
			end
363
			local function waitfordatmoment()
364
				wait(0.2)
365
				local function searchforvelocity(wot)
366
					for i,v in pairs(wot:GetChildren()) do
367
						searchforvelocity(v)
368
						if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then
369
							v:destroy()
370
						end
371
					end
372
				end
373
				searchforvelocity(ragdoll)
374
			end
375
			spawn(waitfordatmoment)
376
			game.Debris:AddItem(ragdoll, 30)
377
		end
378
	end
379
end
380
function damage()
381
	for i,v in pairs(workspace:GetDescendants()) do
382
		if v.ClassName == "Model" then
383
			local head = v:findFirstChild("Head")
384
			local humanoid = v:findFirstChildOfClass("Humanoid")
385
			local torso = v:findFirstChild("Torso")
386
			local ragdolled = v:findFirstChild("ragdolledknife")
387
			if humanoid and head and not ragdolled then
388
				if (head.Position - handle.Position).magnitude < 2.5 and v ~= character and humanoid.Health > 0 then
389
					stabsound.PlaybackSpeed = 1+(math.random(-4,4)/20)
390
					stabsound:Play()
391
					local dmg = math.random(30,50)
392
					if humanoid.Health <= dmg then
393
						humanoid.Health = 0
394
						ragdollkill(v)
395
					end
396
					humanoid.Health = humanoid.Health - dmg
397
					local ragdolledknife = Instance.new("BoolValue", v)
398
					ragdolledknife.Name = "ragdolledknife"
399
					local velocity = Instance.new("BodyVelocity", head)
400
					velocity.MaxForce = Vector3.new(math.huge,0,math.huge)
401
					velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * math.random(5,15)
402
					humanoid.PlatformStand = true
403
					coroutine.wrap(function()
404
						wait(1)
405
						humanoid.PlatformStand = false
406
					end)()
407
					game.Debris:AddItem(ragdolledknife, 1)
408
					game.Debris:AddItem(velocity, 0.2)
409
					if torso then
410
						coroutine.wrap(function()
411
							humanoid = v:WaitForChild("Humanoid")
412
							local ragdoll = v
413
							if ragdoll:findFirstChild("Right Arm") then
414
								local glue = Instance.new("Glue", ragdoll.Torso)
415
								glue.Part0 = ragdoll.Torso
416
								glue.Part1 = ragdoll:findFirstChild("Right Arm")
417
								glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
418
								glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
419
								local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm"))
420
								limbcollider.Size = Vector3.new(10.40,10,10)
421
								limbcollider.Shape = "Cylinder"
422
								limbcollider.Transparency = 1
423
								limbcollider.Name = "LimbCollider"
424
								local limbcolliderweld = Instance.new("Weld", limbcollider)
425
								limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm")
426
								limbcolliderweld.Part1 = limbcollider
427
								limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
428
								coroutine.wrap(function()
429
									if ragdoll.Torso:findFirstChild("Right Shoulder") then
430
										local limbclone = ragdoll.Torso:findFirstChild("Right Shoulder"):Clone()
431
										ragdoll.Torso:findFirstChild("Right Shoulder"):destroy()
432
										coroutine.wrap(function()
433
											wait(1)
434
											limbclone.Parent = ragdoll.Torso
435
											limbclone.Part0 = ragdoll.Torso
436
											limbclone.Part1 = ragdoll["Right Arm"]
437
										end)()
438
									end
439
									wait(1)
440
									glue:destroy()
441
									limbcollider:destroy()
442
									limbcolliderweld:destroy()
443
								end)()
444
							end
445
							if ragdoll:findFirstChild("Left Arm") then
446
								local glue = Instance.new("Glue", ragdoll.Torso)
447
								glue.Part0 = ragdoll.Torso
448
								glue.Part1 = ragdoll:findFirstChild("Left Arm")
449
								glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
450
								glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
451
								local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm"))
452
								limbcollider.Size = Vector3.new(10.40,10,10)
453
								limbcollider.Shape = "Cylinder"
454
								limbcollider.Name = "LimbCollider"
455
								limbcollider.Transparency = 1
456
								local limbcolliderweld = Instance.new("Weld", limbcollider)
457
								limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm")			
458
								limbcolliderweld.Part1 = limbcollider
459
								limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
460
								coroutine.wrap(function()
461
									if ragdoll.Torso:findFirstChild("Left Shoulder") then
462
										local limbclone = ragdoll.Torso:findFirstChild("Left Shoulder"):Clone()
463
										ragdoll.Torso:findFirstChild("Left Shoulder"):destroy()
464
										coroutine.wrap(function()
465
											wait(1)
466
											limbclone.Parent = ragdoll.Torso
467
											limbclone.Part0 = ragdoll.Torso
468
											limbclone.Part1 = ragdoll["Left Arm"]
469
										end)()
470
									end
471
									wait(1)
472
									glue:destroy()
473
									limbcollider:destroy()
474
									limbcolliderweld:destroy()
475
								end)()
476
							end
477
							if ragdoll:findFirstChild("Left Leg") then
478
								local glue = Instance.new("Glue", ragdoll.Torso)
479
								glue.Part0 = ragdoll.Torso
480
								glue.Part1 = ragdoll:findFirstChild("Left Leg")
481
								glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
482
								glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
483
								local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg"))
484-
								limbcollider.Size = Vector3.new(10.50,10,10)
484+
								limbcollider.Size = Vector3.new(10.5,10,10)
485
								limbcollider.Shape = "Cylinder"
486
								limbcollider.Name = "LimbCollider"
487
								limbcollider.Transparency = 1
488
								local limbcolliderweld = Instance.new("Weld", limbcollider)
489
								limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg")
490
								limbcolliderweld.Part1 = limbcollider
491
								limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0)
492
								coroutine.wrap(function()
493
									if ragdoll.Torso:findFirstChild("Left Hip") then
494
										local limbclone = ragdoll.Torso:findFirstChild("Left Hip"):Clone()
495
										ragdoll.Torso:findFirstChild("Left Hip"):destroy()
496
										coroutine.wrap(function()
497
											wait(1)
498
											limbclone.Parent = ragdoll.Torso
499
											limbclone.Part0 = ragdoll.Torso
500
											limbclone.Part1 = ragdoll["Left Leg"]
501
										end)()
502
									end
503
									wait(1)
504
									glue:destroy()
505
									limbcollider:destroy()
506
									limbcolliderweld:destroy()
507
								end)()
508
							end
509
							if ragdoll:findFirstChild("Right Leg") then
510
								local glue = Instance.new("Glue", ragdoll.Torso)
511
								glue.Part0 = ragdoll.Torso
512
								glue.Part1 = ragdoll:findFirstChild("Right Leg")
513
								glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
514
								glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
515
								local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg"))
516-
								limbcollider.Size = Vector3.new(10.50,10,10)
516+
								limbcollider.Size = Vector3.new(10.5,10,10)
517
								limbcollider.Shape = "Cylinder"
518
								limbcollider.Name = "LimbCollider"
519
								limbcollider.Transparency = 1
520
								local limbcolliderweld = Instance.new("Weld", limbcollider)
521
								limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg")
522
								limbcolliderweld.Part1 = limbcollider
523
								limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0)
524
								coroutine.wrap(function()
525
									if ragdoll.Torso:findFirstChild("Right Hip") then
526
										local limbclone = ragdoll.Torso:findFirstChild("Right Hip"):Clone()
527
										ragdoll.Torso:findFirstChild("Right Hip"):destroy()
528
										coroutine.wrap(function()
529
											wait(1)
530
											limbclone.Parent = ragdoll.Torso
531
											limbclone.Part0 = ragdoll.Torso
532
											limbclone.Part1 = ragdoll["Right Leg"]
533
										end)()
534
									end
535
									wait(1)
536
									glue:destroy()
537
									limbcollider:destroy()
538
									limbcolliderweld:destroy()
539
								end)()
540
							end
541
						end)()
542
					end
543
				end
544
			end
545
		end
546
	end
547
end
548
function swooshh()
549
	if owner ~= nil and character ~= nil and canattack then
550
		cananimate = false
551
		canattack = false
552
		local rightarmweld = character.Torso:findFirstChild("RightArmWeldkata")
553
		local leftarmweld = character.Torso:findFirstChild("LeftArmWeldkata")
554
		local headweld = character.Torso:findFirstChild("HeadWeldkata")
555
		local rootweld = character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldkata")
556
		if attacknumber == 1 then
557
			for i = 0,1 , 0.15 do
558
				tool.Grip = tool.Grip * CFrame.fromEulerAnglesXYZ(math.rad(-5),0,0)
559
				headweld.C0 = headweld.C0:lerp(CFrame.new(0, 1.5, 0, 0.866025388, 0, 0.5, 0, 1, 0, -0.5, 0, 0.866025388),i)
560
				rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.64085674, 0.312389612, -0.122621536, 0.939692497, -0.342020065, 0, -0.29619807, -0.813797593, -0.5, 0.171010077, 0.469846338, -0.866025388),i)
561
				leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(1.02380371, 0.612811089, -0.671613693, 0.440969527, -0.84082067, 0.313952357, -0.813797534, -0.522099257, -0.255236179, 0.378522247, -0.14294228, -0.914487958),i)
562
				rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, 0, 0, 0.866025388, 0, -0.5, 0, 1, 0, 0.5, 0, 0.866025388) * CFrame.fromEulerAnglesXYZ(math.rad(10),0,0),i)
563
				runservice.Stepped:wait()
564
			end
565
			trail.Enabled = true
566
			swishsound.PlaybackSpeed = 1+(math.random(-4,4)/20)
567
			swishsound:Play()
568
			for i = 0,1 , 0.15 do
569
				damage()
570
				tool.Grip = tool.Grip * CFrame.fromEulerAnglesXYZ(math.rad(15),0,0)
571
				headweld.C0 = headweld.C0:lerp(CFrame.new(0, 1.5, 0, 0.766044259, 0, -0.642787516, 0, 1, 0, 0.642787516, 0, 0.766044259),i)
572
				rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(0.683202744, -0.20174861, -0.846788406, 0.485379666, 0.55736959, -0.673606277, -0.785861969, 0.615793824, -0.056734439, 0.383180559, 0.556899309, 0.736909389),i)
573
				leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-0.429347992, -0.274533272, -0.938881874, -0.164195985, -0.2279284, -0.959733248, -0.713444591, 0.699326932, -0.0440245233, 0.681201816, 0.677488148, -0.277441025),i)
574
				rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, 0, 0, 0.766044378, 0, 0.642787576, 0, 1, 0, -0.642787576, 0, 0.766044378) * CFrame.fromEulerAnglesXYZ(-math.rad(10),math.rad(20),0),i)
575
				runservice.Stepped:wait()
576
			end
577
			trail.Enabled = false
578
			attacknumber = 2
579
		elseif attacknumber == 2 then
580
			for i = 0,1 , 0.15 do
581
				tool.Grip = tool.Grip * CFrame.fromEulerAnglesXYZ(math.rad(-5),0,0)
582
				headweld.C0 = headweld.C0:lerp(CFrame.new(0.0751914978, 1.49240375, -0.0434103012, 0.640502989, 0.150383756, -0.753087461, -0.0301536862, 0.98480773, 0.171010047, 0.767363608, -0.0868240893, 0.635306776),i)
583
				rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(-0.66223526, 0.676017523, -1.025383, 0.49999997, 0.866025388, -2.98023224e-08, 0.749999762, -0.433012694, -0.5, -0.433012754, 0.25000006, -0.866025448),i)
584
				leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-1.26498032, 0.448050499, -0.739653587, 0.939692616, 0.342020124, 0, 0.262002617, -0.719846368, -0.642787337, -0.219846219, 0.604022563, -0.766044617),i)
585
				rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, 0, 0, 0.642787635, 0, 0.766044438, 0.133022219, 0.98480773, -0.111618899, -0.754406512, 0.173648179, 0.633022249),i)
586
				runservice.Stepped:wait()
587
			end
588
			trail.Enabled = true
589
			swishsound.PlaybackSpeed = 1+(math.random(-4,4)/20)
590
			swishsound:Play()
591
			for i = 0,1 , 0.15 do
592
				damage()
593
				tool.Grip = tool.Grip * CFrame.fromEulerAnglesXYZ(math.rad(15),0,0)
594
				headweld.C0 = headweld.C0:lerp(CFrame.new(0.0641422272, 1.48955965, 0.0788440704, 0.767760158, 0.128285766, 0.627763689, 0.00259800092, 0.979120135, -0.203264251, -0.640731931, 0.15768908, 0.751396239),i)
595
				rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.37565041, -0.222093105, -0.689687729, 0.5, -0.296198189, 0.813797593, 0.749999642, 0.617945373, -0.235888779, -0.433012664, 0.728292406, 0.531121194),i)
596
				leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(0.835933685, -0.400773525, -1.04433632, 0.649519086, -0.755761325, 0.083365947, 0.557579219, 0.39889279, -0.72800374, 0.516942859, 0.519335449, 0.680485249),i)
597
				rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, 0, 0, 0.773788929, 0.0871748775, -0.627416253, 0.0624999851, 0.975144863, 0.212570071, 0.630352676, -0.20369792, 0.749107838),i)
598
				runservice.Stepped:wait()
599
			end
600
			trail.Enabled = false
601
			attacknumber = 3
602
		elseif attacknumber == 3 then
603
			trail.Enabled = true
604
			local rota = 0
605
			tool.Grip = tool.Grip * CFrame.fromEulerAnglesXYZ(math.rad(85),0,math.pi/2)
606
			swishsound:Play()
607
			for i = 1,25 do
608
				damage()
609
				if i == 10 or i == 20 then
610
					swishsound.PlaybackSpeed = 1+(math.random(-4,4)/20)
611
					swishsound:Play()
612
				end
613
				rota = rota + 1
614
				headweld.C0 = CFrame.new(0,1.5,0)
615
				rightarmweld.C0 = CFrame.new(-0.694223404, 0.5, -1.11978149, 2.98023188e-08, 0.99999994, 0, -1.19248798e-08, -4.44089183e-16, -0.99999994, -0.99999994, 2.98023188e-08, 1.19248806e-08)
616
				leftarmweld.C0 = CFrame.new(-1.57922745, 0.5, -0.405579567, 0.984807611, 0.173648179, 0, 7.59040208e-09, -4.30473079e-08, -0.99999994, -0.173648208, 0.98480773, -4.37113883e-08)
617
				rootweld.C0 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0,-math.rad(rota*30),0)
618
				runservice.Stepped:wait()
619
			end
620
			trail.Enabled = false
621
			attacknumber = 1
622
		end
623
		if mouseclick then
624
			coroutine.wrap(function()
625
				local humhp = character:findFirstChildOfClass("Humanoid").Health
626
				while runservice.Stepped:wait() and mouseclick do
627
					if character:findFirstChildOfClass("Humanoid").Health < humhp then
628
						local thedamage = humhp - character:findFirstChildOfClass("Humanoid").Health
629
						character:findFirstChildOfClass("Humanoid").Health = character:findFirstChildOfClass("Humanoid").Health + thedamage/1.5
630
						blocksound.PlaybackSpeed = 1+(math.random(-4,4)/20)
631
						blocksound.TimePosition = 0.05
632
						blocksound:Play()
633
					end
634
					rootweld.C0 = rootweld.C0:lerp(CFrame.new(),0.3)
635
					headweld.C0 = headweld.C0:lerp(CFrame.new(0,1.5,0),0.3)
636
					rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi-math.rad(40),0,0) * CFrame.new(0,-0.5,0),0.3) 
637
					leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ((math.pi/2)-math.rad(10),0,0) * CFrame.new(0,-0.5,0),0.3) 
638
					tool.Grip = tool.Grip:lerp(CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ((math.pi/2),(-math.pi/2)-math.rad(15),math.rad(-25)),0.3)
639
					humhp = character:findFirstChildOfClass("Humanoid").Health
640
				end
641
				cananimate = true
642
				canattack = true
643
			end)()
644
		else
645
			cananimate = true
646
			canattack = true
647
		end
648
	end
649
end
650
tool.Activated:connect(swooshh)
651
--
652
tool.Equipped:connect(function()
653
	equipped = true
654
	trail.Enabled = false
655
	handle.Transparency = 0
656
	owner = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent)
657
	character = owner.Character
658
	local rightarm = Instance.new("Weld", character.Torso)
659
	rightarm.Part0 = character.Torso
660
	rightarm.Part1 = character["Right Arm"]
661
	rightarm.C0 = CFrame.new(1.5,0,0)
662
	rightarm.Name = "RightArmWeldkata"
663
	local leftarm = Instance.new("Weld", character.Torso)
664
	leftarm.Part0 = character.Torso
665
	leftarm.Part1 = character["Left Arm"]
666
	leftarm.C0 = CFrame.new(-1.5,0,0)
667
	leftarm.Name = "LeftArmWeldkata"
668
	local head = Instance.new("Weld", character.Torso)
669
	head.Part0 = character.Torso
670
	head.Part1 = character.Head
671
	head.C0 = CFrame.new(0,1.5,0)
672
	head.Name = "HeadWeldkata"
673
	local humanoidrootpart = Instance.new("Weld", character.HumanoidRootPart)
674
	humanoidrootpart.Part0 = character.HumanoidRootPart
675
	humanoidrootpart.Part1 = character.Torso
676
	humanoidrootpart.Name = "HumanoidRootPartWeldkata"
677
	for i = 0,1 , 0.05 do
678
		humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,math.rad(-25),0),i)
679
		leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-10)) * CFrame.new(0,-0.5,0),i)
680
		rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi+math.rad(10),math.rad(75),0) * CFrame.new(0,-0.5,0),i)
681
		runservice.Stepped:wait()
682
	end
683
	cananimate = true
684
	if character:findFirstChild("KatanaBack") then
685
		character:findFirstChild("KatanaBack").Transparency = 1
686
	end
687
	handle.Transparency = 0
688
	equipsound:Play()
689
	coroutine.wrap(function()
690
		while runservice.Stepped:wait() and equipped do
691
			if cananimate then
692
				tool.Grip = tool.Grip:lerp(CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),0.1)
693
				head.C0 = head.C0:lerp(CFrame.new(0,1.5,0),0.1)
694
				humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(),0.1)
695
				leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.4,0.5,0) * CFrame.fromEulerAnglesXYZ((math.pi/2)-math.rad(50)+math.sin(tick())/15,0,math.rad(50)) * CFrame.new(0,-0.8,0),0.1)
696
				rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ((math.pi/2)-math.rad(35)+math.sin(tick())/15,math.rad(20),math.rad(-40)) * CFrame.new(0,-0.8,0),0.1)
697
			end
698
		end
699
	end)()
700
end)
701
tool.Unequipped:connect(function()
702
	equipped = false
703
	mouseclick = false
704
	cananimate = false
705
	if character.Torso:findFirstChild("LeftArmWeldkata") then
706
		character.Torso:findFirstChild("LeftArmWeldkata"):destroy()
707
	end
708
	if character.Torso:findFirstChild("RightArmWeldkata") then
709
		character.Torso:findFirstChild("RightArmWeldkata"):destroy()
710
	end
711
	if character.Torso:findFirstChild("HeadWeldkata") then
712
		character.Torso:findFirstChild("HeadWeldkata"):destroy()
713
	end
714
	if character:findFirstChild("HumanoidRootPart") then
715
		if character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldkata") then
716
			character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldkata"):destroy()
717
		end
718
	end
719
	if not character:findFirstChild("KatanaBack") then
720
		local clone = handle:Clone()
721
		clone:BreakJoints()
722
		for i,v in pairs(clone:GetDescendants()) do
723
			if v.ClassName ~= "SpecialMesh" and v.ClassName ~= "TouchTransmitter" then
724
				v:destroy()
725
			end
726
		end
727
		local weld = Instance.new("Weld", clone)
728
		weld.Part0 = character.Torso
729
		weld.Part1 = clone
730
		weld.C0 = CFrame.new(0,0,0.55)
731
		weld.C0 = weld.C0 * CFrame.fromEulerAnglesXYZ(0,math.pi/2,math.pi/2)
732
		weld.C0 = weld.C0 * CFrame.fromEulerAnglesXYZ(math.pi,math.rad(-60),0)
733
		clone.Parent = character
734
		clone.Name = "KatanaBack"
735
	else
736
		character:findFirstChild("KatanaBack").Transparency = 0
737
	end
738
	handle.Transparency = 1
739
	character.KatanaBack:findFirstChildOfClass("SpecialMesh").TextureId = handle:findFirstChildOfClass("SpecialMesh").TextureId
740
end)
741
742
end))
743
Part2.Name = "Handle"
744
Part2.Parent = Tool0
745
Part2.CFrame = CFrame.new(17.0572929, 0.300189167, -9.76147747, 0.779687822, 0.000515311665, -0.626168191, -0.000676799158, 0.999999762, -1.97718891e-05, 0.626168072, 0.000439205993, 0.779688001)
746
Part2.Orientation = Vector3.new(0, -38.7700005, -0.0399999991)
747
Part2.Position = Vector3.new(17.0572929, 0.300189167, -9.76147747)
748
Part2.Rotation = Vector3.new(0, -38.7700005, -0.0399999991)
749
Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
750-
Part2.Size = Vector3.new(100.400000036, 100.200000033, 5)
750+
Part2.Size = Vector3.new(1.400000036, 1.200000033, 5)
751
Part2.BottomSurface = Enum.SurfaceType.Smooth
752
Part2.BrickColor = BrickColor.new("Dark stone grey")
753
Part2.Reflectance = 0.40000000596046
754
Part2.TopSurface = Enum.SurfaceType.Smooth
755
Part2.brickColor = BrickColor.new("Dark stone grey")
756
SpecialMesh3.Parent = Part2
757
SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=11442510"
758
SpecialMesh3.Scale = Vector3.new(1.70000005, 1.70000005, 1.70000005)
759
SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=11442524"
760
SpecialMesh3.MeshType = Enum.MeshType.FileMesh
761
Sound4.Name = "Swoosh"
762
Sound4.Parent = Part2
763
Sound4.SoundId = "rbxassetid://1489705211"
764
Sound4.Volume = 0.69999998807907
765
Sound5.Name = "Equip"
766
Sound5.Parent = Part2
767
Sound5.SoundId = "rbxassetid://211059653"
768
Sound5.Volume = 1
769
Sound6.Name = "Stab"
770
Sound6.Parent = Part2
771
Sound6.SoundId = "rbxassetid://4471648128"
772
Trail7.Parent = Part2
773
Trail7.Attachment0 = nil
774
Trail7.Attachment1 = nil
775
Trail7.LightInfluence = 1
776
Trail7.Transparency = NumberSequence.new(0.80000001192093,0.80000001192093)
777
Trail7.Lifetime = 0.10000000149012
778
Sound8.Name = "Clang"
779
Sound8.Parent = Part2
780
Sound8.SoundId = "rbxassetid://357622136"
781
Sound8.Volume = 1
782
for i,v in pairs(mas:GetChildren()) do
783
	v.Parent = owner.Character
784
	pcall(function() v:MakeJoints() end)
785
end
786
mas:Destroy()
787
for i,v in pairs(cors) do
788
	spawn(function()
789
		pcall(v)
790
	end)
791
end