Advertisement
VoidScript

Demonos

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