View difference between Paste ID: U9qWbGja and A4y5fsDY
SHOW: | | - or go back to the newest paste.
1
------------------------------
2
3
--Made by goodguyaiden--------
4
--Sassy Girl------------------
5
6
------------------------------
7
-- This script has been converted to FE by iPxter
8
9-
local Player = game:service'Players'.localPlayer
9+
10
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
11-
Player=game:GetService("Players").LocalPlayer
11+
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
12
do
13
	print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
14
	script.Parent = Player.Character
15
16
	--RemoteEvent for communicating
17
	local Event = Instance.new("RemoteEvent")
18
	Event.Name = "UserInput_Event"
19
20
	--Fake event to make stuff like Mouse.KeyDown work
21
	local function fakeEvent()
22
		local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
23
		t.connect = t.Connect
24
		return t
25
	end
26
27
	--Creating fake input objects with fake variables
28
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
29
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
30
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
31
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
32
	end}
33
	--Merged 2 functions into one by checking amount of arguments
34
	CAS.UnbindAction = CAS.BindAction
35
36
	--This function will trigger the events that have been :Connect()'ed
37
	local function te(self,ev,...)
38
		local t = m[ev]
39-
Player = game:GetService("Players").LocalPlayer
39+
		if t and t._fakeEvent and t.Function then
40
			t.Function(...)
41
		end
42
	end
43
	m.TrigEvent = te
44
	UIS.TrigEvent = te
45-
Mouse = Player:GetMouse()
45+
46
	Event.OnServerEvent:Connect(function(plr,io)
47
	    if plr~=Player then return end
48
		if io.isMouse then
49
			m.Target = io.Target
50
			m.Hit = io.Hit
51
		else
52
			local b = io.UserInputState == Enum.UserInputState.Begin
53
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
54
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
55
			end
56
			for _,t in pairs(CAS.Actions) do
57
				for _,k in pairs(t.Keys) do
58
					if k==io.KeyCode then
59-
local Player = game:service'Players'.localPlayer
59+
						t.Function(t.Name,io.UserInputState,io)
60
					end
61
				end
62
			end
63
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
64
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
65
	    end
66
	end)
67
	Event.Parent = NLS([==[
68
	local Player = game:GetService("Players").LocalPlayer
69
	local Event = script:WaitForChild("UserInput_Event")
70
71
	local UIS = game:GetService("UserInputService")
72
	local input = function(io,a)
73
		if a then return end
74
		--Since InputObject is a client-side instance, we create and pass table instead
75
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
76
	end
77
	UIS.InputBegan:Connect(input)
78
	UIS.InputEnded:Connect(input)
79
80
	local Mouse = Player:GetMouse()
81
	local h,t
82
	--Give the server mouse data 30 times every second, but only if the values changed
83
	--If player is not moving their mouse, client won't fire events
84
	while wait(1/30) do
85
		if h~=Mouse.Hit or t~=Mouse.Target then
86
			h,t=Mouse.Hit,Mouse.Target
87
			Event:FireServer({isMouse=true,Target=t,Hit=h})
88
		end
89
	end]==],Player.Character)
90
	Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
91
end
92
93
wait(0.2)
94
local Player = owner
95
local chara = Player.Character
96
Player=owner
97
Character=Player.Character 
98
PlayerGui=Player.PlayerGui
99
Backpack=Player.Backpack 
100
Torso=Character.Torso 
101
Head=Character.Head 
102
Humanoid=Character.Humanoid
103
m=Instance.new('Model',Character)
104
LeftArm=Character["Left Arm"] 
105
LeftLeg=Character["Left Leg"] 
106
RightArm=Character["Right Arm"] 
107
RightLeg=Character["Right Leg"] 
108
LS=Torso["Left Shoulder"] 
109
LH=Torso["Left Hip"] 
110
RS=Torso["Right Shoulder"] 
111
RH=Torso["Right Hip"] 
112
Face = Head.face
113
Neck=Torso.Neck
114
it=Instance.new
115
attacktype=1
116
vt=Vector3.new
117
cf=CFrame.new
118
cl3=Color3.new
119
rgb=Color3.fromRGB
120
bcn=BrickColor.new
121
euler=CFrame.fromEulerAnglesXYZ
122
angles=CFrame.Angles
123
Humanoid.WalkSpeed = 16
124
Player = owner
125
PlayerGui = Player.PlayerGui
126
Cam = workspace.CurrentCamera
127
Backpack = Player.Backpack
128
Character = Player.Character
129
Humanoid = Character.Humanoid
130
RootPart = Character["HumanoidRootPart"]
131
Torso = Character["Torso"]
132
Head = Character["Head"]
133
RightArm = Character["Right Arm"]
134
LeftArm = Character["Left Arm"]
135
RightLeg = Character["Right Leg"]
136
LeftLeg = Character["Left Leg"]
137
RootJoint = RootPart["RootJoint"]
138
Neck = Torso["Neck"]
139
RightShoulder = Torso["Right Shoulder"]
140
LeftShoulder = Torso["Left Shoulder"]
141
RightHip = Torso["Right Hip"]
142
LeftHip = Torso["Left Hip"]
143
local Player = owner
144
local chara = Player.Character
145
      
146
	    shirt= Instance.new("Shirt", Character)
147
        shirt.Name = "Shirt"
148
        pants = Instance.new("Pants", Character)
149
        pants.Name = "Pants"
150
        chara.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=0"
151
        chara.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=405297110"
152
pumpk = Instance.new("Sound")
153
pumpk.Parent = game.Players.LocalPlayer.Character.Head
154
pumpk.SoundId = "rbxassetid://1267328508"
155
pumpk.Volume = 3
156
pumpk.Looped = true
157
pumpk:Play()
158
IT = Instance.new
159
CF = CFrame.new
160
VT = Vector3.new
161
RAD = math.rad
162
C3 = Color3.new
163
UD2 = UDim2.new
164
BRICKC = BrickColor.new
165
ANGLES = CFrame.Angles
166
EULER = CFrame.fromEulerAnglesXYZ
167
COS = math.cos
168
ACOS = math.acos
169
SIN = math.sin
170
ASIN = math.asin
171
ABS = math.abs
172
MRANDOM = math.random
173
FLOOR = math.floor
174
Animation_Speed = 3
175
Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
176
local Speed = 12
177
local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
178
local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
179
local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
180
local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
181
local DAMAGEMULTIPLIER = 1
182
local ANIM = "Idle"
183
local ATTACK = false
184
local EQUIPPED = false
185
local HOLD = false
186
local COMBO = 1
187
local Rooted = false
188
local SINE = 0
189
local KEYHOLD = false
190
local CHANGE = 2 / Animation_Speed
191
local WALKINGANIM = false
192
local VALUE1 = false
193
local VALUE2 = false
194
local ROBLOXIDLEANIMATION = IT("Animation")
195
ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
196
ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
197
--ROBLOXIDLEANIMATION.Parent = Humanoid
198
local WEAPONGUI = IT("ScreenGui", PlayerGui)
199
WEAPONGUI.Name = "Weapon GUI"
200
local Weapon = IT("Model")
201
Weapon.Name = "Adds"
202
local Effects = IT("Folder", Weapon)
203
Effects.Name = "Effects"
204
local ANIMATOR = Humanoid.Animator
205
local ANIMATE = Character.Animate
206
local UNANCHOR = true
207
local PLAYANIMS = true
208
ArtificialHB = Instance.new("BindableEvent", script)
209
ArtificialHB.Name = "ArtificialHB"
210
211
script:WaitForChild("ArtificialHB")
212
213
frame = Frame_Speed
214
tf = 0
215
allowframeloss = false
216
tossremainder = false
217
lastframe = tick()
218
script.ArtificialHB:Fire()
219
220
function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
221
	return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
222
end
223
224
function PositiveAngle(NUMBER)
225
	if NUMBER >= 0 then
226
		NUMBER = 0
227
	end
228
	return NUMBER
229
end
230
231
function NegativeAngle(NUMBER)
232
	if NUMBER <= 0 then
233
		NUMBER = 0
234
	end
235
	return NUMBER
236
end
237
238
function Swait(NUMBER)
239
	if NUMBER == 0 or NUMBER == nil then
240
		ArtificialHB.Event:wait()
241
	else
242
		for i = 1, NUMBER do
243
			ArtificialHB.Event:wait()
244
		end
245
	end
246
end
247
248
function QuaternionFromCFrame(cf)
249
	local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
250
	local trace = m00 + m11 + m22
251
	if trace > 0 then 
252
		local s = math.sqrt(1 + trace)
253
		local recip = 0.5 / s
254
		return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
255
	else
256
		local i = 0
257
		if m11 > m00 then
258
			i = 1
259
		end
260
		if m22 > (i == 0 and m00 or m11) then
261
			i = 2
262
		end
263
		if i == 0 then
264
			local s = math.sqrt(m00 - m11 - m22 + 1)
265
			local recip = 0.5 / s
266
			return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
267
		elseif i == 1 then
268
			local s = math.sqrt(m11 - m22 - m00 + 1)
269
			local recip = 0.5 / s
270
			return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
271
		elseif i == 2 then
272
			local s = math.sqrt(m22 - m00 - m11 + 1)
273
			local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
274
		end
275
	end
276
end
277
 
278
function QuaternionToCFrame(px, py, pz, x, y, z, w)
279
	local xs, ys, zs = x + x, y + y, z + z
280
	local wx, wy, wz = w * xs, w * ys, w * zs
281
	local xx = x * xs
282
	local xy = x * ys
283
	local xz = x * zs
284
	local yy = y * ys
285
	local yz = y * zs
286
	local zz = z * zs
287
	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))
288
end
289
 
290
function QuaternionSlerp(a, b, t)
291
	local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
292
	local startInterp, finishInterp;
293
	if cosTheta >= 0.0001 then
294
		if (1 - cosTheta) > 0.0001 then
295
			local theta = ACOS(cosTheta)
296
			local invSinTheta = 1 / SIN(theta)
297
			startInterp = SIN((1 - t) * theta) * invSinTheta
298
			finishInterp = SIN(t * theta) * invSinTheta
299
		else
300
			startInterp = 1 - t
301
			finishInterp = t
302
		end
303
	else
304
		if (1 + cosTheta) > 0.0001 then
305
			local theta = ACOS(-cosTheta)
306
			local invSinTheta = 1 / SIN(theta)
307
			startInterp = SIN((t - 1) * theta) * invSinTheta
308
			finishInterp = SIN(t * theta) * invSinTheta
309
		else
310
			startInterp = t - 1
311
			finishInterp = t
312
		end
313
	end
314
	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
315
end
316
317
function Clerp(a, b, t)
318
	local qa = {QuaternionFromCFrame(a)}
319
	local qb = {QuaternionFromCFrame(b)}
320
	local ax, ay, az = a.x, a.y, a.z
321
	local bx, by, bz = b.x, b.y, b.z
322
	local _t = 1 - t
323
	return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
324
end
325
326
function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
327
	local frame = IT("Frame")
328
	frame.BackgroundTransparency = TRANSPARENCY
329
	frame.BorderSizePixel = BORDERSIZEPIXEL
330
	frame.Position = POSITION
331
	frame.Size = SIZE
332
	frame.BackgroundColor3 = COLOR
333
	frame.BorderColor3 = BORDERCOLOR
334
	frame.Name = NAME
335
	frame.Parent = PARENT
336
	return frame
337
end
338
339
function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
340
	local label = IT("TextLabel")
341
	label.BackgroundTransparency = 1
342
	label.Size = UD2(1, 0, 1, 0)
343
	label.Position = UD2(0, 0, 0, 0)
344
	label.TextColor3 = TEXTCOLOR
345
	label.TextStrokeTransparency = STROKETRANSPARENCY
346
	label.TextTransparency = TRANSPARENCY
347
	label.FontSize = TEXTFONTSIZE
348
	label.Font = TEXTFONT
349
	label.BorderSizePixel = BORDERSIZEPIXEL
350
	label.TextScaled = false
351
	label.Text = TEXT
352
	label.Name = NAME
353
	label.Parent = PARENT
354
	return label
355
end
356
357
function NoOutlines(PART)
358
	PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
359
end
360
361
362
function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
363
	local NEWWELD = IT(TYPE)
364
	NEWWELD.Part0 = PART0
365
	NEWWELD.Part1 = PART1
366
	NEWWELD.C0 = C0
367
	NEWWELD.C1 = C1
368
	NEWWELD.Parent = PARENT
369
	return NEWWELD
370
end
371
372
local S = IT("Sound")
373
374
function CreateSound(ID, PARENT, VOLUME, PITCH)
375
	local NEWSOUND = nil
376
	coroutine.resume(coroutine.create(function()
377
		NEWSOUND = S:Clone()
378
		NEWSOUND.Parent = PARENT
379
		NEWSOUND.Volume = VOLUME
380
		NEWSOUND.Pitch = PITCH
381
		NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
382
		Swait()
383
		NEWSOUND:play()
384
		game:GetService("Debris"):AddItem(NEWSOUND, 10)
385
	end))
386
	return NEWSOUND
387
end
388
389
function CFrameFromTopBack(at, top, back)
390
	local right = top:Cross(back)
391
	return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
392
end
393
394
function CreateWave(SIZE,WAIT,CFRAME,DOESROT,ROT,COLOR,GROW)
395
	local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(0,0,0))
396
	local mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
397
	wave.CFrame = CFRAME
398
	coroutine.resume(coroutine.create(function(PART)
399
		for i = 1, WAIT do
400
			Swait()
401
			mesh.Scale = mesh.Scale + GROW
402
			mesh.Offset = VT(0,0,-(mesh.Scale.X/8))
403
			if DOESROT == true then
404
				wave.CFrame = wave.CFrame * CFrame.fromEulerAnglesXYZ(0,ROT,0)
405
			end
406
			wave.Transparency = wave.Transparency + (0.5/WAIT)
407
			if wave.Transparency > 0.99 then
408
				wave:remove()
409
			end
410
		end
411
	end))
412
end
413
414
function CreateRing(SIZE,DOESROT,ROT,WAIT,CFRAME,COLOR,GROW)
415
	local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(0,0,0))
416
	local mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "559831844", "", SIZE, VT(0,0,0))
417
	wave.CFrame = CFRAME
418
	coroutine.resume(coroutine.create(function(PART)
419
		for i = 1, WAIT do
420
			Swait()
421
			mesh.Scale = mesh.Scale + GROW
422
			if DOESROT == true then
423
				wave.CFrame = wave.CFrame * CFrame.fromEulerAnglesXYZ(0,ROT,0)
424
			end
425
			wave.Transparency = wave.Transparency + (0.5/WAIT)
426
			if wave.Transparency > 0.99 then
427
				wave:remove()
428
			end
429
		end
430
	end))
431
end
432
433
function MagicSphere(SIZE,WAIT,CFRAME,COLOR,GROW)
434
	local wave = CreatePart(3, Effects, "Neon", 0, 0, BRICKC(COLOR), "Effect", VT(1,1,1), true)
435
	local mesh = CreateMesh("SpecialMesh", wave, "Sphere", "", "", SIZE, VT(0,0,0))
436
	wave.CFrame = CFRAME
437
	coroutine.resume(coroutine.create(function(PART)
438
		for i = 1, WAIT do
439
			Swait()
440
			mesh.Scale = mesh.Scale + GROW
441
			wave.Transparency = wave.Transparency + (1/WAIT)
442
			if wave.Transparency > 0.99 then
443
				wave:remove()
444
			end
445
		end
446
	end))
447
end
448
449
function Slice(KIND,SIZE,WAIT,CFRAME,COLOR,GROW)
450
	local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(1,1,1), true)
451
	local mesh = nil
452
	if KIND == "Base" then
453
 		mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "448386996", "", VT(0,SIZE/10,SIZE/10), VT(0,0,0))
454
	elseif KIND == "Thin" then
455
 		mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "662586858", "", VT(SIZE/10,0,SIZE/10), VT(0,0,0))
456
	elseif KIND == "Round" then
457
 		mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "662585058", "", VT(SIZE/10,0,SIZE/10), VT(0,0,0))
458
	end
459
	wave.CFrame = CFRAME
460
	coroutine.resume(coroutine.create(function(PART)
461
		for i = 1, WAIT do
462
			Swait()
463
			mesh.Scale = mesh.Scale + GROW/10
464
			wave.Transparency = wave.Transparency + (0.5/WAIT)
465
			if wave.Transparency > 0.99 then
466
				wave:remove()
467
			end
468
		end
469
	end))
470
end
471
472
function MakeForm(PART,TYPE)
473
	if TYPE == "Cyl" then
474
		local MSH = IT("CylinderMesh",PART)
475
	elseif TYPE == "Ball" then
476
		local MSH = IT("SpecialMesh",PART)
477
		MSH.MeshType = "Sphere"
478
	elseif TYPE == "Wedge" then
479
		local MSH = IT("SpecialMesh",PART)
480
		MSH.MeshType = "Wedge"
481
	end
482
end
483
484
485
function CheckTableForString(Table, String)
486
	for i, v in pairs(Table) do
487
		if string.find(string.lower(String), string.lower(v)) then
488
			return true
489
		end
490
	end
491
	return false
492
end
493
494
function CheckIntangible(Hit)
495
	local ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Lightning", "Bullet"}
496
	if Hit and Hit.Parent then
497
		if ((not Hit.CanCollide or CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid")) then
498
			return true
499
		end
500
	end
501
	return false
502
end
503
504
Debris = game:GetService("Debris")
505
506
function CastZapRay(StartPos, Vec, Length, Ignore, DelayIfHit)
507
	local Direction = CFrame.new(StartPos, Vec).lookVector
508
	local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore})
509
	local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Direction * Length), Ignore)
510
	if RayHit and CheckIntangible(RayHit) then
511
		if DelayIfHit then
512
			wait()
513
		end
514
		RayHit, RayPos, RayNormal = CastZapRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit)
515
	end
516
	return RayHit, RayPos, RayNormal
517
end
518
519
function turnto(position)
520
	RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0)
521
end
522
523
524
525
game:GetService("RunService").Heartbeat:connect(function(s, p)
526
	tf = tf + s
527
	if tf >= frame then
528
		if allowframeloss then
529
			script.ArtificialHB:Fire()
530
			lastframe = tick()
531
		else
532
			for i = 1, math.floor(tf / frame) do
533
				script.ArtificialHB:Fire()
534
			end
535
		lastframe = tick()
536
		end
537
		if tossremainder then
538
			tf = 0
539
		else
540
			tf = tf - frame * math.floor(tf / frame)
541
		end
542
	end
543
end)
544
function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
545
	return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
546
end
547
548
function PositiveAngle(NUMBER)
549
	if NUMBER >= 0 then
550
		NUMBER = 0
551
	end
552
	return NUMBER
553
end
554
555
function NegativeAngle(NUMBER)
556
	if NUMBER <= 0 then
557
		NUMBER = 0
558
	end
559
	return NUMBER
560
end
561
562
function Swait(NUMBER)
563
	if NUMBER == 0 or NUMBER == nil then
564
		ArtificialHB.Event:wait()
565
	else
566
		for i = 1, NUMBER do
567
			ArtificialHB.Event:wait()
568
		end
569
	end
570
end
571
572
function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
573
	local NEWMESH = IT(MESH)
574
	if MESH == "SpecialMesh" then
575
		NEWMESH.MeshType = MESHTYPE
576
		if MESHID ~= "nil" and MESHID ~= "" then
577
			NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
578
		end
579
		if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
580
			NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
581
		end
582
	end
583
	NEWMESH.Offset = OFFSET or VT(0, 0, 0)
584
	NEWMESH.Scale = SCALE
585
	NEWMESH.Parent = PARENT
586
	return NEWMESH
587
end
588
589
function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
590
	local NEWPART = IT("Part")
591
	NEWPART.formFactor = FORMFACTOR
592
	NEWPART.Reflectance = REFLECTANCE
593
	NEWPART.Transparency = TRANSPARENCY
594
	NEWPART.CanCollide = false
595
	NEWPART.Locked = true
596
	NEWPART.Anchored = true
597
	if ANCHOR == false then
598
		NEWPART.Anchored = false
599
	end
600
	NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
601
	NEWPART.Name = NAME
602
	NEWPART.Size = SIZE
603
	NEWPART.Position = Torso.Position
604
	NEWPART.Material = MATERIAL
605
	NEWPART:BreakJoints()
606
	NEWPART.Parent = PARENT
607
	return NEWPART
608
end
609
610
	local function weldBetween(a, b)
611
	    local weldd = Instance.new("ManualWeld")
612
	    weldd.Part0 = a
613
	    weldd.Part1 = b
614
	    weldd.C0 = CFrame.new()
615
	    weldd.C1 = b.CFrame:inverse() * a.CFrame
616
	    weldd.Parent = a
617
	    return weldd
618
	end
619
620
621
function QuaternionFromCFrame(cf)
622
	local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
623
	local trace = m00 + m11 + m22
624
	if trace > 0 then 
625
		local s = math.sqrt(1 + trace)
626
		local recip = 0.5 / s
627
		return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
628
	else
629
		local i = 0
630
		if m11 > m00 then
631
			i = 1
632
		end
633
		if m22 > (i == 0 and m00 or m11) then
634
			i = 2
635
		end
636
		if i == 0 then
637
			local s = math.sqrt(m00 - m11 - m22 + 1)
638
			local recip = 0.5 / s
639
			return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
640
		elseif i == 1 then
641
			local s = math.sqrt(m11 - m22 - m00 + 1)
642
			local recip = 0.5 / s
643
			return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
644
		elseif i == 2 then
645
			local s = math.sqrt(m22 - m00 - m11 + 1)
646
			local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
647
		end
648
	end
649
end
650
 
651
function QuaternionToCFrame(px, py, pz, x, y, z, w)
652
	local xs, ys, zs = x + x, y + y, z + z
653
	local wx, wy, wz = w * xs, w * ys, w * zs
654
	local xx = x * xs
655
	local xy = x * ys
656
	local xz = x * zs
657
	local yy = y * ys
658
	local yz = y * zs
659
	local zz = z * zs
660
	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))
661
end
662
 
663
function QuaternionSlerp(a, b, t)
664
	local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
665
	local startInterp, finishInterp;
666
	if cosTheta >= 0.0001 then
667
		if (1 - cosTheta) > 0.0001 then
668
			local theta = ACOS(cosTheta)
669
			local invSinTheta = 1 / SIN(theta)
670
			startInterp = SIN((1 - t) * theta) * invSinTheta
671
			finishInterp = SIN(t * theta) * invSinTheta
672
		else
673
			startInterp = 1 - t
674
			finishInterp = t
675
		end
676
	else
677
		if (1 + cosTheta) > 0.0001 then
678
			local theta = ACOS(-cosTheta)
679
			local invSinTheta = 1 / SIN(theta)
680
			startInterp = SIN((t - 1) * theta) * invSinTheta
681
			finishInterp = SIN(t * theta) * invSinTheta
682
		else
683
			startInterp = t - 1
684
			finishInterp = t
685
		end
686
	end
687
	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
688
end
689
690
function Clerp(a, b, t)
691
	local qa = {QuaternionFromCFrame(a)}
692
	local qb = {QuaternionFromCFrame(b)}
693
	local ax, ay, az = a.x, a.y, a.z
694
	local bx, by, bz = b.x, b.y, b.z
695
	local _t = 1 - t
696
	return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
697
end
698
699
function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
700
	local frame = IT("Frame")
701
	frame.BackgroundTransparency = TRANSPARENCY
702
	frame.BorderSizePixel = BORDERSIZEPIXEL
703
	frame.Position = POSITION
704
	frame.Size = SIZE
705
	frame.BackgroundColor3 = COLOR
706
	frame.BorderColor3 = BORDERCOLOR
707
	frame.Name = NAME
708
	frame.Parent = PARENT
709
	return frame
710
end
711
712
function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
713
	local label = IT("TextLabel")
714
	label.BackgroundTransparency = 1
715
	label.Size = UD2(1, 0, 1, 0)
716
	label.Position = UD2(0, 0, 0, 0)
717
	label.TextColor3 = TEXTCOLOR
718
	label.TextStrokeTransparency = STROKETRANSPARENCY
719
	label.TextTransparency = TRANSPARENCY
720
	label.FontSize = TEXTFONTSIZE
721
	label.Font = TEXTFONT
722
	label.BorderSizePixel = BORDERSIZEPIXEL
723
	label.TextScaled = false
724
	label.Text = TEXT
725
	label.Name = NAME
726
	label.Parent = PARENT
727
	return label
728
end
729
730
function NoOutlines(PART)
731
	PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
732
end
733
734
function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
735
	local NEWWELD = IT(TYPE)
736
	NEWWELD.Part0 = PART0
737
	NEWWELD.Part1 = PART1
738
	NEWWELD.C0 = C0
739
	NEWWELD.C1 = C1
740
	NEWWELD.Parent = PARENT
741
	return NEWWELD
742
end
743
744
local S = IT("Sound")
745
function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
746
	local NEWSOUND = nil
747
	coroutine.resume(coroutine.create(function()
748
		NEWSOUND = S:Clone()
749
		NEWSOUND.Parent = PARENT
750
		NEWSOUND.Volume = VOLUME
751
		NEWSOUND.Pitch = PITCH
752
		NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
753
		NEWSOUND:play()
754
		if DOESLOOP == true then
755
			NEWSOUND.Looped = true
756
		else
757
			repeat wait(1) until NEWSOUND.Playing == false
758
			NEWSOUND:remove()
759
		end
760
	end))
761
	return NEWSOUND
762
end
763
764
function MakeForm(PART,TYPE)
765
	if TYPE == "Cyl" then
766
		local MSH = IT("CylinderMesh",PART)
767
	elseif TYPE == "Ball" then
768
		local MSH = IT("SpecialMesh",PART)
769
		MSH.MeshType = "Sphere"
770
	elseif TYPE == "Wedge" then
771
		local MSH = IT("SpecialMesh",PART)
772
		MSH.MeshType = "Wedge"
773
	end
774
end
775
776
function CFrameFromTopBack(at, top, back)
777
	local right = top:Cross(back)
778
	return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
779
end
780
781
function PuddleOfBlood(Position,MaxDrop,Model,MaxSize)
782
	local HITFLOOR, HITPOS, NORMAL = Raycast(Position, (CF(Position, Position + VT(0, -1, 0))).lookVector, MaxDrop, Model)
783
	if HITFLOOR ~= nil then
784
		if HITFLOOR.Parent ~= Weapon and HITFLOOR.Parent ~= Character then
785
			if HITFLOOR.Name == "BloodPuddle" then
786
				local DIST = (Position - HITFLOOR.Position).Magnitude
787
				if (HITFLOOR.Size.Z <= 5 and HITFLOOR.Size.Z < MaxSize) or (HITFLOOR.Size.Z > 5 and HITFLOOR.Size.Z < MaxSize and DIST < HITFLOOR.Size.Z/3) then
788
					HITFLOOR.Size = HITFLOOR.Size + VT(0.1,0,0.1)
789
				end
790
			else
791
				if HITFLOOR.Anchored == true then
792
					local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(2,0,2))
793
					BLOOD.CFrame = CF(HITPOS,HITPOS+NORMAL)*ANGLES(RAD(90),RAD(0),RAD(0))
794
					MakeForm(BLOOD,"Cyl")
795
					coroutine.resume(coroutine.create(function()
796
						Swait(75)
797
						while true do
798
							Swait()
799
							BLOOD.Size = BLOOD.Size - VT(0.02,0,0.02)
800
							if BLOOD.Size.Z < 0.051 then
801
								BLOOD:remove()
802
								break
803
							end
804
						end
805
					end))
806
				end
807
			end
808
		end
809
	end
810
end
811
812
function SprayBlood(POSITION,DIRECTION,BloodSize)
813
	local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(0.3,0.3,0.3),false)
814
	BLOOD.CFrame = CF(POSITION)
815
	MakeForm(BLOOD,"Ball")
816
	local bv = Instance.new("BodyVelocity",BLOOD) 
817
	bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
818
	bv.velocity = CF(POSITION,DIRECTION+VT(MRANDOM(-3,3)/30,MRANDOM(-3,3)/30,MRANDOM(-3,3)/30)).lookVector*75
819
	bv.Name = "MOVE"
820
	Debris:AddItem(bv,0.05)
821
	coroutine.resume(coroutine.create(function()
822
		local HASTOUCHEDGROUND = false
823
		local HIT = BLOOD.Touched:Connect(function(hit)
824
			if hit.Anchored == true then
825
				HASTOUCHEDGROUND = true
826
				PuddleOfBlood(BLOOD.Position+VT(0,1,0),2,BLOOD,BloodSize)
827
			end
828
		end)
829
		wait(5)
830
		if HASTOUCHEDGROUND == false then
831
			BLOOD:remove()
832
		end
833
	end))
834
end
835
836
Debris = game:GetService("Debris")
837
838
function CastProperRay(StartPos, EndPos, Distance, Ignore)
839
	local DIRECTION = CF(StartPos,EndPos).lookVector
840
	return Raycast(StartPos, DIRECTION, Distance, Ignore)
841
end
842
843
function turnto(position)
844
	RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0)
845
end
846
847
function recurse(root,callback,i)
848
	i= i or 0
849
	for _,v in pairs(root:GetChildren()) do
850
		i = i + 1
851
		callback(i,v)
852
		
853
		if #v:GetChildren() > 0 then
854
			i = recurse(v,callback,i)
855
		end
856
	end
857
	
858
	return i
859
end
860
861
function ragdollJoint(character, part0, part1, attachmentName, className, properties)
862
	attachmentName = attachmentName.."RigAttachment"
863
	local constraint = Instance.new(className.."Constraint")
864
	constraint.Attachment0 = part0:FindFirstChild(attachmentName)
865
	constraint.Attachment1 = part1:FindFirstChild(attachmentName)
866
	constraint.Name = "RagdollConstraint"..part1.Name
867
	
868
	for _,propertyData in next,properties or {} do
869
		constraint[propertyData[1]] = propertyData[2]
870
	end
871
	
872
	constraint.Parent = character
873
end
874
875
function getAttachment0(character, attachmentName)
876
	for _,child in next,character:GetChildren() do
877
		local attachment = child:FindFirstChild(attachmentName)
878
		if attachment then
879
			return attachment
880
		end
881
	end
882
end
883
884
function R15Ragdoll(character)
885
	recurse(character, function(_,v)
886
		if v:IsA("Attachment") then
887
			v.Axis = Vector3.new(0, 1, 0)
888
			v.SecondaryAxis = Vector3.new(0, 0, 1)
889
			v.Rotation = Vector3.new(0, 0, 0)
890
		end
891
	end)
892
	for _,child in next,character:GetChildren() do
893
		if child:IsA("Accoutrement") then
894
			for _,part in next,child:GetChildren() do
895
				if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
896
					local attachment1 = part:FindFirstChildOfClass("Attachment")
897
					local attachment0 = getAttachment0(character,attachment1.Name)
898
					if attachment0 and attachment1 then
899
						local constraint = Instance.new("HingeConstraint")
900
						constraint.Attachment0 = attachment0
901
						constraint.Attachment1 = attachment1
902
						constraint.LimitsEnabled = true
903
						constraint.UpperAngle = 0
904
						constraint.LowerAngle = 0
905
						constraint.Parent = character
906
					end
907
				elseif part.Name == "HumanoidRootPart" then
908
					part:remove()
909
				end
910
			end
911
		end
912
	end
913
	
914
	ragdollJoint(character,character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", {
915
		{"LimitsEnabled",true};
916
		{"UpperAngle",5};
917
	})
918
	ragdollJoint(character,character.UpperTorso, character.Head, "Neck", "BallSocket", {
919
		{"LimitsEnabled",true};
920
		{"UpperAngle",15};
921
	})
922
	
923
	local handProperties = {
924
		{"LimitsEnabled", true};
925
		{"UpperAngle",0};
926
		{"LowerAngle",0};
927
	}
928
	ragdollJoint(character,character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties)
929
	ragdollJoint(character,character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties)
930
	
931
	local shinProperties = {
932
		{"LimitsEnabled", true};
933
		{"UpperAngle", 0};
934
		{"LowerAngle", -75};
935
	}
936
	ragdollJoint(character,character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties)
937
	ragdollJoint(character,character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties)
938
	
939
	local footProperties = {
940
		{"LimitsEnabled", true};
941
		{"UpperAngle", 15};
942
		{"LowerAngle", -45};
943
	}
944
	ragdollJoint(character,character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties)
945
	ragdollJoint(character,character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties)
946
	
947
	ragdollJoint(character,character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket")
948
	ragdollJoint(character,character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket")
949
	ragdollJoint(character,character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket")
950
	ragdollJoint(character,character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket")
951
	ragdollJoint(character,character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket")
952
	ragdollJoint(character,character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket")
953
end
954
955
function Ragdoll(Character2,CharTorso)
956
	Character2:BreakJoints()
957
	local hum = Character2:findFirstChild("Humanoid")
958
	hum:remove()
959
	local function Scan(ch)
960
		local e
961
		for e = 1,#ch do
962
			Scan(ch[e]:GetChildren())
963
			if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
964
				ch[e]:remove()
965
			end
966
		end
967
	end
968
	local NEWHUM = IT("Humanoid")
969
	NEWHUM.Name = "Corpse"
970
	NEWHUM.Health = 0
971
	NEWHUM.MaxHealth = 0
972
	NEWHUM.PlatformStand = true
973
	NEWHUM.Parent = Character2
974
	NEWHUM.DisplayDistanceType = "None"
975
976
	local ch = Character2:GetChildren()
977
	local i
978
	for i = 1,#ch do
979
		if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
980
			ch[i]:remove()
981
		end
982
	end
983
984
	local Torso2 = Character2.Torso
985
	local movevector = Vector3.new()
986
987
	if Torso2 then
988
		movevector = CFrame.new(CharTorso.Position,Torso2.Position).lookVector
989
		local Head = Character2:FindFirstChild("Head")
990
		if Head then
991
			local Neck = Instance.new("Weld")
992
			Neck.Name = "Neck"
993
			Neck.Part0 = Torso2
994
			Neck.Part1 = Head
995
			Neck.C0 = CFrame.new(0, 1.5, 0)
996
			Neck.C1 = CFrame.new()
997
			Neck.Parent = Torso2
998
999
		end
1000
		local Limb = Character2:FindFirstChild("Right Arm")
1001
		if Limb then
1002
1003
			Limb.CFrame = Torso2.CFrame * CFrame.new(1.5, 0, 0)
1004
			local Joint = Instance.new("Glue")
1005
			Joint.Name = "RightShoulder"
1006
			Joint.Part0 = Torso2
1007
			Joint.Part1 = Limb
1008
			Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
1009
			Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
1010
			Joint.Parent = Torso2
1011
1012
			local B = Instance.new("Part")
1013
			B.TopSurface = 0
1014
			B.BottomSurface = 0
1015
			B.formFactor = "Symmetric"
1016
			B.Size = Vector3.new(1, 1, 1)
1017
			B.Transparency = 1
1018
			B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
1019
			B.Parent = Character2
1020
			local W = Instance.new("Weld")
1021
			W.Part0 = Limb
1022
			W.Part1 = B
1023
			W.C0 = CFrame.new(0, -0.5, 0)
1024
			W.Parent = Limb
1025
1026
		end
1027
		local Limb = Character2:FindFirstChild("Left Arm")
1028
		if Limb then
1029
1030
			Limb.CFrame = Torso2.CFrame * CFrame.new(-1.5, 0, 0)
1031
			local Joint = Instance.new("Glue")
1032
			Joint.Name = "LeftShoulder"
1033
			Joint.Part0 = Torso2
1034
			Joint.Part1 = Limb
1035
			Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
1036
			Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
1037
			Joint.Parent = Torso2
1038
1039
			local B = Instance.new("Part")
1040
			B.TopSurface = 0
1041
			B.BottomSurface = 0
1042
			B.formFactor = "Symmetric"
1043
			B.Size = Vector3.new(1, 1, 1)
1044
			B.Transparency = 1
1045
			B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
1046
			B.Parent = Character2
1047
			local W = Instance.new("Weld")
1048
			W.Part0 = Limb
1049
			W.Part1 = B
1050
			W.C0 = CFrame.new(0, -0.5, 0)
1051
			W.Parent = Limb
1052
1053
		end
1054
		local Limb = Character2:FindFirstChild("Right Leg")
1055
		if Limb then
1056
1057
			Limb.CFrame = Torso2.CFrame * CFrame.new(0.5, -2, 0)
1058
			local Joint = Instance.new("Glue")
1059
			Joint.Name = "RightHip"
1060
			Joint.Part0 = Torso2
1061
			Joint.Part1 = Limb
1062
			Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
1063
			Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
1064
			Joint.Parent = Torso2
1065
1066
			local B = Instance.new("Part")
1067
			B.TopSurface = 0
1068
			B.BottomSurface = 0
1069
			B.formFactor = "Symmetric"
1070
			B.Size = Vector3.new(1, 1, 1)
1071
			B.Transparency = 1
1072
			B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
1073
			B.Parent = Character2
1074
			local W = Instance.new("Weld")
1075
			W.Part0 = Limb
1076
			W.Part1 = B
1077
			W.C0 = CFrame.new(0, -0.5, 0)
1078
			W.Parent = Limb
1079
1080
		end
1081
		local Limb = Character2:FindFirstChild("Left Leg")
1082
		if Limb then
1083
1084
			Limb.CFrame = Torso2.CFrame * CFrame.new(-0.5, -2, 0)
1085
			local Joint = Instance.new("Glue")
1086
			Joint.Name = "LeftHip"
1087
			Joint.Part0 = Torso2
1088
			Joint.Part1 = Limb
1089
			Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
1090
			Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
1091
			Joint.Parent = Torso2
1092
1093
			local B = Instance.new("Part")
1094
			B.TopSurface = 0
1095
			B.BottomSurface = 0
1096
			B.formFactor = "Symmetric"
1097
			B.Size = Vector3.new(1, 1, 1)
1098
			B.Transparency = 1
1099
			B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
1100
			B.Parent = Character2
1101
			local W = Instance.new("Weld")
1102
			W.Part0 = Limb
1103
			W.Part1 = B
1104
			W.C0 = CFrame.new(0, -0.5, 0)
1105
			W.Parent = Limb
1106
1107
		end
1108
		--[
1109
		local Bar = Instance.new("Part")
1110
		Bar.TopSurface = 0
1111
		Bar.BottomSurface = 0
1112
		Bar.formFactor = "Symmetric"
1113
		Bar.Size = Vector3.new(1, 1, 1)
1114
		Bar.Transparency = 1
1115
		Bar.CFrame = Torso2.CFrame * CFrame.new(0, 0.5, 0)
1116
		Bar.Parent = Character2
1117
		local Weld = Instance.new("Weld")
1118
		Weld.Part0 = Torso2
1119
		Weld.Part1 = Bar
1120
		Weld.C0 = CFrame.new(0, 0.5, 0)
1121
		Weld.Parent = Torso2
1122
		--]]
1123
	end
1124
	Character2.Parent = workspace
1125
	Debris:AddItem(Character2,5)
1126
1127
	return Character2,Torso2
1128
end
1129
1130
we = true
1131
1132
local le = CreatePart(3, Character, "SmoothPlastic", 0, 0, "Really black", "le", VT(0, 0, 0),false)
1133
local HandleMesh = CreateMesh("SpecialMesh", le, "FileMesh", "746694198", "0", VT(1,1,1), VT(0,0, 0))
1134
local Weld = CreateWeldOrSnapOrMotor("Weld", le, LeftArm, le, CF(0, -1.8, -0.2) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0))
1135
1136
local txt = Instance.new("BillboardGui", chara)
1137
CV="Lime green"
1138
    txt.Adornee = chara.Head
1139
    txt.Name = "_status"
1140
    txt.Size = UDim2.new(2, 0, 1.2, 0)
1141
    txt.StudsOffset = Vector3.new(-9, 8, 0)
1142
    local text = Instance.new("TextLabel", txt)
1143
    text.Size = UDim2.new(10, 0, 7, 0)
1144
    text.FontSize = "Size24"
1145
    text.TextScaled = true
1146
    text.TextTransparency = 0
1147
    text.BackgroundTransparency = 1
1148
    text.TextTransparency = 0
1149
    text.TextStrokeTransparency = 0
1150
    text.Font = "Bodoni"
1151
    text.TextStrokeColor3 = BrickColor.new("Carnation pink").Color
1152
    text.TextColor3 = BrickColor.new("Light reddish violet").Color
1153
    text.Text = ""
1154
1155
1156
function EW()
1157
    text.Text = "Ew"
1158
we = true
1159
	ATTACK = true
1160
	Rooted = true
1161
CreateSound("838721484", Head, 10, 1)
1162
game.Players.LocalPlayer.Character["le"].Touched:connect(function(hit)
1163
    local humanoid = hit.Parent:findFirstChild("Humanoid")
1164
    if we == true then
1165
        humanoid:TakeDamage(10)
1166
    end
1167
end)
1168
	for i=0, 1, 0.1 / Animation_Speed do
1169
		Swait()
1170
		RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.5 / Animation_Speed)
1171
		Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(12), RAD(0), RAD(20)), 0.5 / Animation_Speed)
1172
		RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.55, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)
1173
		LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.55, 0) * ANGLES(RAD(150), RAD(0), RAD(40)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
1174
		RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
1175
		LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)	
1176
	end
1177
wait(1)
1178
we = false
1179
    text.Text = ""
1180
	ATTACK = false
1181
	Rooted = false
1182
end
1183
1184
1185
1186
function MouseDown(Mouse)
1187
end
1188
1189
function MouseUp(Mouse)
1190
HOLD = false
1191
end
1192
1193
function KeyDown(Key)
1194
	KEYHOLD = true
1195
	if Key == "q" and ATTACK == false then
1196
		EW()
1197
1198
	end
1199
end
1200
1201
function KeyUp(Key)
1202
	KEYHOLD = false
1203
end
1204
1205
	Mouse.Button1Down:connect(function(NEWKEY)
1206
		MouseDown(NEWKEY)
1207
	end)
1208
	Mouse.Button1Up:connect(function(NEWKEY)
1209
		MouseUp(NEWKEY)
1210
	end)
1211
	Mouse.KeyDown:connect(function(NEWKEY)
1212
		KeyDown(NEWKEY)
1213
	end)
1214
	Mouse.KeyUp:connect(function(NEWKEY)
1215
		KeyUp(NEWKEY)
1216
	end)
1217
1218
1219
Humanoid.Changed:connect(function(Jump)
1220
	if Jump == "Jump" and (Disable_Jump == true) then
1221
		Humanoid.Jump = false
1222
	end
1223
end)
1224
1225
while true do
1226
	Swait()
1227
	script.Parent = WEAPONGUI
1228
	ANIMATE.Parent = nil
1229
	for _,v in next, Humanoid:GetPlayingAnimationTracks() do
1230
	    v:Stop();
1231
	end
1232
	SINE = SINE + CHANGE
1233
	local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude
1234
	local TORSOVERTICALVELOCITY = RootPart.Velocity.y
1235
	local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character)
1236
	local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16)
1237
	if ANIM == "Walk" and TORSOVELOCITY > 1 then
1238
		RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, -0.15 * COS(SINE / (WALKSPEEDVALUE / 2))) * ANGLES(RAD(0), RAD(0) - RootPart.RotVelocity.Y / 75, RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1239
		Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(2.5 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0) - Head.RotVelocity.Y / 30), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1240
		RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 0.875 - 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ 0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0) - RightLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.3 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1241
		LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 0.875 + 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), 0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ -0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0) + LeftLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.3 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1242
	elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then
1243
		RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1244
		Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1245
		RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1246
		LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1247
	end
1248
	if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then
1249
		ANIM = "Jump"
1250
		if PLAYANIMS == true then
1251
			RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1252
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1253
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(20)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed)
1254
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
1255
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.3) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(-20)), 0.2 / Animation_Speed)
1256
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.3) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(20)), 0.2 / Animation_Speed)
1257
	    end
1258
	elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then
1259
		ANIM = "Fall"
1260
		if PLAYANIMS == true then
1261
			RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1262
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1263
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(100), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed)
1264
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-100), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
1265
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(20)), 0.2 / Animation_Speed)
1266
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10)), 0.2 / Animation_Speed)
1267
		end
1268
	elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then
1269
		ANIM = "Idle"
1270
		if PLAYANIMS == true then
1271
			RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(4 - 6 * SIN(SINE / 12)), RAD(0)), 0.15 / Animation_Speed)
1272
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(10 - 20 * SIN(SINE / 12))), 0.15 / Animation_Speed)
1273
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-30)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed)
1274
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-30)) * LEFTSHOULDERC0, 0.15 / Animation_Speed)
1275
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1276
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1277
		end
1278
	elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then
1279
		ANIM = "Walk"
1280
		if PLAYANIMS == true then
1281
		RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1282
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1283
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-30)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed)
1284
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-30)) * LEFTSHOULDERC0, 0.15 / Animation_Speed)
1285
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1286
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1287
			end
1288
		end
1289
	end
1290
	if Rooted == false then
1291
		Disable_Jump = false
1292
		Humanoid.WalkSpeed = Speed
1293
	elseif Rooted == true then
1294
		Disable_Jump = true
1295
		Humanoid.WalkSpeed = 0
1296
	end
1297
1298
	Humanoid.Health = Humanoid.Health + 1