Advertisement
SirMemz

Untitled

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