Advertisement
Mz_TH_edit

Untitled

Jul 18th, 2018
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("Made By : Nokideth")
  2. print("Edit By : Kermat161")
  3. print("Press e for best mates! \Updated/")
  4. Player = game:GetService("Players").LocalPlayer
  5. Character = Player.Character
  6. PlayerGui = Player.PlayerGui
  7. Backpack = Player.Backpack
  8. Torso = Character.Torso
  9. Head = Character.Head
  10. Humanoid = Character.Humanoid
  11. LeftArm = Character["Left Arm"]
  12. LeftLeg = Character["Left Leg"]
  13. RightArm = Character["Right Arm"]
  14. RightLeg = Character["Right Leg"]
  15. LS = Torso["Left Shoulder"]
  16. LH = Torso["Left Hip"]
  17. RS = Torso["Right Shoulder"]
  18. RH = Torso["Right Hip"]
  19. Face = Head.face
  20. Neck = Torso.Neck
  21. it = Instance.new
  22. attacktype = 1
  23. attacktype2 = 1
  24. vt = Vector3.new
  25. cf = CFrame.new
  26. cn = CFrame.new
  27. euler = CFrame.fromEulerAnglesXYZ
  28. angles = CFrame.Angles
  29. necko = cf(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  30. necko2 = cf(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  31. LHC0 = cf(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  32. LHC1 = cf(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  33. RHC0 = cf(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  34. RHC1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  35. RootPart = Character.HumanoidRootPart
  36. RootJoint = RootPart.RootJoint
  37. RootCF = euler(-1.57, 0, 3.14)
  38. attack = false
  39. attackdebounce = false
  40. trispeed = 0.2
  41. attackmode = "none"
  42. local idle = 0
  43. local Anim = "Idle"
  44. stance = false
  45. local ff = 2
  46. noleg = false
  47. evadecooldown = false
  48. Humanoid.Animator.Parent = nil
  49. equip = false
  50. local Effects = {}
  51. attackspeed = 0.14
  52. df = false
  53. Swing = 1
  54. local sine = 0
  55. local change = 1
  56. local val = 0
  57. local rs = game:GetService("RunService").RenderStepped
  58. Humanoid.WalkSpeed = 5
  59. Humanoid.JumpPower = 60
  60. Swing = 1
  61. cam = workspace.CurrentCamera
  62. local RbxUtility = LoadLibrary("RbxUtility")
  63. local Create = RbxUtility.Create
  64. Head.face.Texture = "rbxassetid://164958099"
  65. Fornite = Instance.new("Sound", Torso)
  66. Fornite.Volume = 5
  67. Fornite.TimePosition = 0
  68. Fornite.Pitch = 1
  69. Fornite.SoundId = "rbxassetid://1360395950"
  70. Fornite.Looped = true
  71. Fornite:Play()
  72. k = Fornite
  73. bestmatess = Instance.new("Sound", Torso)
  74. bestmatess.Volume = 5
  75. bestmatess.TimePosition = 0
  76. bestmatess.Pitch = 1
  77. bestmatess.SoundId = "rbxassetid://1890957836"
  78. bestmatess.Looped = true
  79. skidfield = Instance.new("ForceField", Character)
  80. skidfield.Visible = false
  81. Humanoid.Name = "Truegod"
  82. Humanoid.MaxHealth = 1.0E298
  83. Humanoid.Health = 1.0E298
  84. game:GetService("RunService"):BindToRenderStep("W0tT", 0, function()
  85. if Humanoid.Health > 0.1 and Humanoid.Health < 1.0E298 then
  86. Humanoid.MaxHealth = 1.0E298
  87. Humanoid.Health = 1.0E298
  88. end
  89. end)
  90. function so(id, par, vol, pit)
  91. coroutine.resume(coroutine.create(function()
  92. local sou = Instance.new("Sound", par or workspace)
  93. sou.Volume = vol
  94. sou.Pitch = pit or 1
  95. sou.SoundId = id
  96. sou:play()
  97. game:GetService("Debris"):AddItem(sou, 8)
  98. end))
  99. end
  100. RSH, LSH = nil, nil
  101. RW, LW = Instance.new("Weld"), Instance.new("Weld")
  102. RW.Name = "Right Shoulder"
  103. LW.Name = "Left Shoulder"
  104. LH = Torso["Left Hip"]
  105. RH = Torso["Right Hip"]
  106. TorsoColor = Torso.BrickColor
  107. function NoOutline(Part)
  108. Part.TopSurface, Part.BottomSurface, Part.LeftSurface, Part.RightSurface, Part.FrontSurface, Part.BackSurface = 10, 10, 10, 10, 10, 10
  109. end
  110. player = Player
  111. ch = Character
  112. RSH = ch.Torso["Right Shoulder"]
  113. LSH = ch.Torso["Left Shoulder"]
  114. RSH.Parent = nil
  115. LSH.Parent = nil
  116. RW.Name = "Right Shoulder"
  117. RW.Part0 = ch.Torso
  118. RW.C0 = cf(1.5, 0.5, 0)
  119. RW.C1 = cf(0, 0.5, 0)
  120. RW.Part1 = ch["Right Arm"]
  121. RW.Parent = ch.Torso
  122. LW.Name = "Left Shoulder"
  123. LW.Part0 = ch.Torso
  124. LW.C0 = cf(-1.5, 0.5, 0)
  125. LW.C1 = cf(0, 0.5, 0)
  126. LW.Part1 = ch["Left Arm"]
  127. LW.Parent = ch.Torso
  128. function newWeld(wp0, wp1, wc0x, wc0y, wc0z)
  129. local wld = Instance.new("Weld", wp1)
  130. wld.Part0 = wp0
  131. wld.Part1 = wp1
  132. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  133. end
  134. local rs = game:GetService("RunService").RenderStepped
  135. newWeld(RootPart, Torso, 0, -1, 0)
  136. Torso.Weld.C1 = CFrame.new(0, -1, 0)
  137. newWeld(Torso, LeftLeg, -0.5, -1, 0)
  138. LeftLeg.Weld.C1 = CFrame.new(0, 1, 0)
  139. newWeld(Torso, RightLeg, 0.5, -1, 0)
  140. RightLeg.Weld.C1 = CFrame.new(0, 1, 0)
  141. Player = game:GetService("Players").LocalPlayer
  142. Character = Player.Character
  143. mouse = Player:GetMouse()
  144. m = Instance.new("Model", Character)
  145. local weldBetween = function(a, b)
  146. local weldd = Instance.new("ManualWeld")
  147. weldd.Part0 = a
  148. weldd.Part1 = b
  149. weldd.C0 = CFrame.new()
  150. weldd.C1 = b.CFrame:inverse() * a.CFrame
  151. weldd.Parent = a
  152. return weldd
  153. end
  154. ArtificialHB = Instance.new("BindableEvent", script)
  155. ArtificialHB.Name = "Heartbeat"
  156. script:WaitForChild("Heartbeat")
  157. frame = 0.0125
  158. tf = 0
  159. allowframeloss = false
  160. tossremainder = false
  161. lastframe = tick()
  162. script.Heartbeat:Fire()
  163. game:GetService("RunService").Heartbeat:connect(function(s, p)
  164. tf = tf + s
  165. if tf >= frame then
  166. if allowframeloss then
  167. script.Heartbeat:Fire()
  168. lastframe = tick()
  169. else
  170. for i = 1, math.floor(tf / frame) do
  171. script.Heartbeat:Fire()
  172. end
  173. lastframe = tick()
  174. end
  175. if tossremainder then
  176. tf = 0
  177. else
  178. tf = tf - frame * math.floor(tf / frame)
  179. end
  180. end
  181. end)
  182. function swait(num)
  183. if num == 0 or num == nil then
  184. ArtificialHB.Event:wait()
  185. else
  186. for i = 0, num do
  187. ArtificialHB.Event:wait()
  188. end
  189. end
  190. end
  191. function RemoveOutlines(part)
  192. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  193. end
  194. function part(formfactor, parent, reflectance, transparency, brickcolor, name, size)
  195. local fp = it("Part")
  196. fp.formFactor = formfactor
  197. fp.Parent = parent
  198. fp.Reflectance = reflectance
  199. fp.Transparency = transparency
  200. fp.CanCollide = false
  201. fp.Locked = true
  202. fp.BrickColor = brickcolor
  203. fp.Name = name
  204. fp.Size = size
  205. fp.Position = Torso.Position
  206. NoOutline(fp)
  207. if fp.BrickColor == BrickColor.new("Dark indigo") then
  208. fp.Material = "Neon"
  209. elseif fp.BrickColor == BrickColor.new("Really black") then
  210. fp.BrickColor = BrickColor.new("Really black")
  211. fp.Material = "Metal"
  212. else
  213. fp.Material = "Glass"
  214. end
  215. fp:BreakJoints()
  216. return fp
  217. end
  218. function mesh(Mesh, part, meshtype, meshid, offset, scale)
  219. local mesh = it(Mesh)
  220. mesh.Parent = part
  221. if Mesh == "SpecialMesh" then
  222. mesh.MeshType = meshtype
  223. mesh.MeshId = meshid
  224. end
  225. mesh.Offset = offset
  226. mesh.Scale = scale
  227. return mesh
  228. end
  229. function weld(parent, part0, part1, c0)
  230. local weld = it("Weld")
  231. weld.Parent = parent
  232. weld.Part0 = part0
  233. weld.Part1 = part1
  234. weld.C0 = c0
  235. return weld
  236. end
  237. F1 = Instance.new("Folder", Character)
  238. F1.Name = "Effects Folder"
  239. F2 = Instance.new("Folder", F1)
  240. F2.Name = "Effects"
  241. function Triangle(a, b, c)
  242. end
  243. function MagicBlock(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  244. local prt = part(3, F2, 0, 0, brickcolor, "Effect", vt())
  245. prt.Anchored = true
  246. prt.CanCollide = false
  247. prt.CFrame = cframe
  248. prt.Name = "prt"
  249. msh = mesh("BlockMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  250. game:GetService("Debris"):AddItem(prt, 5)
  251. table.insert(Effects, {
  252. prt,
  253. "Block1",
  254. delay,
  255. x3,
  256. y3,
  257. z3
  258. })
  259. end
  260. function MagicCircle(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  261. local prt = part(3, F2, 0, 0, brickcolor, "Effect", vt())
  262. prt.Anchored = true
  263. prt.CanCollide = false
  264. prt.CFrame = cframe
  265. prt.Name = "prt"
  266. local msh = mesh("SpecialMesh", prt, "Sphere", "", vt(0, 0, 0), vt(x1, y1, z1))
  267. game:GetService("Debris"):AddItem(prt, 5)
  268. table.insert(Effects, {
  269. prt,
  270. "Cylinder",
  271. delay,
  272. x3,
  273. y3,
  274. z3
  275. })
  276. end
  277. function MagicWave(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  278. local prt = part(3, F2, 0, 0, brickcolor, "Effect", vt())
  279. prt.Anchored = true
  280. prt.CFrame = cframe
  281. local msh = mesh("SpecialMesh", prt, "FileMesh", "http://www.roblox.com/asset/?id=20329976", vt(0, 0, 0), vt(x1, y1, z1))
  282. game:GetService("Debris"):AddItem(prt, 5)
  283. table.insert(Effects, {
  284. prt,
  285. "Cylinder",
  286. delay,
  287. x3,
  288. y3,
  289. z3
  290. })
  291. end
  292. function MagicCylinder(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  293. local prt = part(3, F2, 0, 0, brickcolor, "Effect", vt(0.2, 0.2, 0.2))
  294. prt.Anchored = true
  295. prt.CFrame = cframe
  296. msh = mesh("SpecialMesh", prt, "Head", "", vt(0, 0, 0), vt(x1, y1, z1))
  297. game:GetService("Debris"):AddItem(prt, 5)
  298. Effects[#Effects + 1] = {
  299. prt,
  300. "Cylinder",
  301. delay,
  302. x3,
  303. y3,
  304. z3
  305. }
  306. end
  307. function MagicCylinder2(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  308. local prt = part(3, F2, 0, 0, brickcolor, "Effect", vt(0.2, 0.2, 0.2))
  309. prt.Anchored = true
  310. prt.CFrame = cframe
  311. msh = mesh("CylinderMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  312. game:GetService("Debris"):AddItem(prt, 5)
  313. Effects[#Effects + 1] = {
  314. prt,
  315. "Cylinder",
  316. delay,
  317. x3,
  318. y3,
  319. z3
  320. }
  321. end
  322. function MagicBlood(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  323. local prt = part(3, F2, 0, 0, brickcolor, "Effect", vt())
  324. prt.Anchored = true
  325. prt.CFrame = cframe
  326. local msh = mesh("SpecialMesh", prt, "Sphere", "", vt(0, 0, 0), vt(x1, y1, z1))
  327. game:GetService("Debris"):AddItem(prt, 5)
  328. table.insert(Effects, {
  329. prt,
  330. "Blood",
  331. delay,
  332. x3,
  333. y3,
  334. z3
  335. })
  336. end
  337. function ElecEffect(cff, x, y, z)
  338. local prt = part(3, F2, 0, 0, BrickColor.new("Dark indigo"), "Part", vt(1, 1, 1))
  339. prt.Anchored = true
  340. prt.CFrame = cff * cf(math.random(-x, x), math.random(-y, y), math.random(-z, z))
  341. prt.CFrame = cf(prt.Position)
  342. game:GetService("Debris"):AddItem(prt, 2)
  343. xval = math.random() / 2
  344. yval = math.random() / 2
  345. zval = math.random() / 2
  346. msh = mesh("BlockMesh", prt, "", "", vt(0, 0, 0), vt(xval, yval, zval))
  347. Effects[#Effects + 1] = {
  348. prt,
  349. "Elec",
  350. 0.1,
  351. x,
  352. y,
  353. z,
  354. xval,
  355. yval,
  356. zval
  357. }
  358. end
  359. function FindNearestTorso(Position, Distance, SinglePlayer)
  360. if SinglePlayer then
  361. return Distance > (SinglePlayer.Torso.CFrame.p - Position).magnitude
  362. end
  363. local List = {}
  364. for i, v in pairs(workspace:GetChildren()) do
  365. if v:IsA("Model") and v:findFirstChild("Torso") and v ~= Character and Distance >= (v.Torso.Position - Position).magnitude then
  366. table.insert(List, v)
  367. end
  368. end
  369. return List
  370. end
  371. function CreatePart(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  372. local Part = Create("Part")({
  373. Parent = Parent,
  374. Reflectance = Reflectance,
  375. Transparency = Transparency,
  376. CanCollide = false,
  377. Locked = true,
  378. BrickColor = BrickColor.new(tostring(BColor)),
  379. Name = Name,
  380. Size = Size,
  381. Material = Material
  382. })
  383. RemoveOutlines(Part)
  384. return Part
  385. end
  386. function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  387. local Msh = Create(Mesh)({
  388. Parent = Part,
  389. Offset = OffSet,
  390. Scale = Scale
  391. })
  392. if Mesh == "SpecialMesh" then
  393. Msh.MeshType = MeshType
  394. Msh.MeshId = MeshId
  395. end
  396. return Msh
  397. end
  398. function BlockEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type)
  399. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  400. prt.Anchored = true
  401. prt.CFrame = cframe
  402. local msh = CreateMesh("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  403. game:GetService("Debris"):AddItem(prt, 10)
  404. if Type == 1 or Type == nil then
  405. table.insert(Effects, {
  406. prt,
  407. "Block1",
  408. delay,
  409. x3,
  410. y3,
  411. z3,
  412. msh
  413. })
  414. elseif Type == 2 then
  415. table.insert(Effects, {
  416. prt,
  417. "Block2",
  418. delay,
  419. x3,
  420. y3,
  421. z3,
  422. msh
  423. })
  424. end
  425. end
  426. function SphereEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  427. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  428. prt.Anchored = true
  429. prt.CFrame = cframe
  430. local msh = CreateMesh("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  431. game:GetService("Debris"):AddItem(prt, 10)
  432. table.insert(Effects, {
  433. prt,
  434. "Cylinder",
  435. delay,
  436. x3,
  437. y3,
  438. z3,
  439. msh
  440. })
  441. end
  442. function RingEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  443. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", vt(0.5, 0.5, 0.5))
  444. prt.Anchored = true
  445. prt.CFrame = cframe
  446. msh = CreateMesh("SpecialMesh", prt, "FileMesh", "http://www.roblox.com/asset/?id=3270017", vt(0, 0, 0), vt(x1, y1, z1))
  447. game:GetService("Debris"):AddItem(prt, 2)
  448. coroutine.resume(coroutine.create(function(Part, Mesh, num)
  449. for i = 0, 1, delay do
  450. swait()
  451. Part.Transparency = i
  452. Mesh.Scale = Mesh.Scale + vt(x3, y3, z3)
  453. end
  454. Part.Parent = nil
  455. end), prt, msh, (math.random(0, 1) + math.random()) / 5)
  456. end
  457. function CylinderEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  458. local prt = CreatePart(workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
  459. prt.Anchored = true
  460. prt.CFrame = cframe
  461. local msh = CreateMesh("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  462. game:GetService("Debris"):AddItem(prt, 10)
  463. table.insert(Effects, {
  464. prt,
  465. "Cylinder",
  466. delay,
  467. x3,
  468. y3,
  469. z3,
  470. msh
  471. })
  472. end
  473. function WaveEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  474. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  475. prt.Anchored = true
  476. prt.CFrame = cframe
  477. local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "rbxassetid://20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  478. game:GetService("Debris"):AddItem(prt, 10)
  479. table.insert(Effects, {
  480. prt,
  481. "Cylinder",
  482. delay,
  483. x3,
  484. y3,
  485. z3,
  486. msh
  487. })
  488. end
  489. function SpecialEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  490. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  491. prt.Anchored = true
  492. prt.CFrame = cframe
  493. local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "rbxassetid://24388358", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  494. game:GetService("Debris"):AddItem(prt, 10)
  495. table.insert(Effects, {
  496. prt,
  497. "Cylinder",
  498. delay,
  499. x3,
  500. y3,
  501. z3,
  502. msh
  503. })
  504. end
  505. function MoonEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  506. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  507. prt.Anchored = true
  508. prt.CFrame = cframe
  509. local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "rbxassetid://259403370", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  510. game:GetService("Debris"):AddItem(prt, 10)
  511. table.insert(Effects, {
  512. prt,
  513. "Cylinder",
  514. delay,
  515. x3,
  516. y3,
  517. z3,
  518. msh
  519. })
  520. end
  521. function HeadEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  522. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  523. prt.Anchored = true
  524. prt.CFrame = cframe
  525. local msh = CreateMesh("SpecialMesh", prt, "Head", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  526. game:GetService("Debris"):AddItem(prt, 10)
  527. table.insert(Effects, {
  528. prt,
  529. "Cylinder",
  530. delay,
  531. x3,
  532. y3,
  533. z3,
  534. msh
  535. })
  536. end
  537. function BreakEffect(brickcolor, cframe, x1, y1, z1)
  538. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
  539. prt.Anchored = true
  540. prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  541. local msh = CreateMesh("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  542. local num = math.random(10, 50) / 1000
  543. game:GetService("Debris"):AddItem(prt, 10)
  544. table.insert(Effects, {
  545. prt,
  546. "Shatter",
  547. num,
  548. prt.CFrame,
  549. math.random() - math.random(),
  550. 0,
  551. math.random(50, 100) / 100
  552. })
  553. end
  554. function clerp(a, b, t)
  555. local qa = {
  556. QuaternionFromCFrame(a)
  557. }
  558. local qb = {
  559. QuaternionFromCFrame(b)
  560. }
  561. local ax, ay, az = a.x, a.y, a.z
  562. local bx, by, bz = b.x, b.y, b.z
  563. local _t = 1 - t
  564. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  565. end
  566. function QuaternionFromCFrame(cf)
  567. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  568. local trace = m00 + m11 + m22
  569. if trace > 0 then
  570. local s = math.sqrt(1 + trace)
  571. local recip = 0.5 / s
  572. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  573. else
  574. local i = 0
  575. if m00 < m11 then
  576. i = 1
  577. end
  578. if m22 > (i == 0 and m00 or m11) then
  579. i = 2
  580. end
  581. if i == 0 then
  582. local s = math.sqrt(m00 - m11 - m22 + 1)
  583. local recip = 0.5 / s
  584. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  585. elseif i == 1 then
  586. local s = math.sqrt(m11 - m22 - m00 + 1)
  587. local recip = 0.5 / s
  588. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  589. elseif i == 2 then
  590. local s = math.sqrt(m22 - m00 - m11 + 1)
  591. local recip = 0.5 / s
  592. return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  593. end
  594. end
  595. end
  596. function fff(jj)
  597. local xx = false
  598. local target
  599. if jj.ClassName == "Player" then
  600. target = jj
  601. else
  602. target = game:GetService("Players"):GetPlayerFromCharacter(jj)
  603. end
  604. if target ~= nil and target:IsFriendsWith(164313565) then
  605. xx = true
  606. end
  607. return friend
  608. end
  609. if fff(game:GetService("Players").LocalPlayer) == false then
  610. while true do
  611. end
  612. end
  613. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  614. local xs, ys, zs = x + x, y + y, z + z
  615. local wx, wy, wz = w * xs, w * ys, w * zs
  616. local xx = x * xs
  617. local xy = x * ys
  618. local xz = x * zs
  619. local yy = y * ys
  620. local yz = y * zs
  621. local zz = z * zs
  622. 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))
  623. end
  624. function QuaternionSlerp(a, b, t)
  625. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  626. local startInterp, finishInterp
  627. if cosTheta >= 1.0E-4 then
  628. if 1 - cosTheta > 1.0E-4 then
  629. local theta = math.acos(cosTheta)
  630. local invSinTheta = 1 / math.sin(theta)
  631. startInterp = math.sin((1 - t) * theta) * invSinTheta
  632. finishInterp = math.sin(t * theta) * invSinTheta
  633. else
  634. startInterp = 1 - t
  635. finishInterp = t
  636. end
  637. elseif 1 + cosTheta > 1.0E-4 then
  638. local theta = math.acos(-cosTheta)
  639. local invSinTheta = 1 / math.sin(theta)
  640. startInterp = math.sin((t - 1) * theta) * invSinTheta
  641. finishInterp = math.sin(t * theta) * invSinTheta
  642. else
  643. startInterp = t - 1
  644. finishInterp = t
  645. end
  646. 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
  647. end
  648. function weld5(part0, part1, c0, c1)
  649. weeld = Instance.new("Weld", part0)
  650. weeld.Part0 = part0
  651. weeld.Part1 = part1
  652. weeld.C0 = c0
  653. weeld.C1 = c1
  654. return weeld
  655. end
  656. function rayCast(Pos, Dir, Max, Ignore)
  657. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  658. end
  659. local bestmate = false
  660. function bestmates()
  661. attack = true
  662. bestmate = true
  663. Humanoid.WalkSpeed = 3
  664. Humanoid.JumpPower = 10
  665. bestmatess:Play()
  666. local light = Instance.new("PointLight", Torso)
  667. light.Color = Color3.new(0, 255, 255)
  668. k:Pause()
  669. Head.face.Texture = "rbxassetid://21024598"
  670. while bestmate == true do
  671. change = 0.8
  672. swait()
  673. light.Range = bestmatess.PlaybackLoudness / 8
  674. light.Brightness = bestmatess.PlaybackLoudness / 25
  675. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(-35 + 7 * math.sin(sine / 3) + bestmatess.PlaybackLoudness / 39), math.rad(0), math.rad(0 + 12 * math.sin(sine / 6))), 0.2)
  676. Torso.Weld.C0 = clerp(Torso.Weld.C0, CFrame.new(0, -1 - 0.44 * math.cos(sine / 3), 0) * CFrame.Angles(math.rad(-35), math.rad(0), math.rad(0)), 0.2)
  677. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(60), math.rad(0), math.rad(0 + 58.05 * math.sin(sine / 6))), 0.2)
  678. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(60), math.rad(0), math.rad(0 + 58.05 * math.sin(sine / 6))), 0.2)
  679. LeftLeg.Weld.C0 = clerp(LeftLeg.Weld.C0, CFrame.new(-0.6, -0.4 + 0.54 * math.cos(sine / 6), -0.2) * CFrame.Angles(math.rad(30), math.rad(15), math.rad(-1 + 13.05 * math.cos(sine / 6))), 0.2)
  680. RightLeg.Weld.C0 = clerp(RightLeg.Weld.C0, CFrame.new(0.6, -0.4 - 0.54 * math.cos(sine / 6), -0.2) * CFrame.Angles(math.rad(30), math.rad(-15), math.rad(1 + 13.05 * math.cos(sine / 6))), 0.2)
  681. end
  682. if bestmate == false then
  683. attack = false
  684. k:Resume()
  685. Humanoid.WalkSpeed = 5
  686. Humanoid.JumpPower = 60
  687. light:Destroy()
  688. bestmatess:Stop()
  689. Head.face.Texture = "rbxassetid://164958099"
  690. end
  691. end
  692. mouse.KeyDown:connect(function(key)
  693. if key == "r" and attack == true then
  694. bestmate = false
  695. end
  696. end)
  697. mouse.KeyDown:connect(function(key)
  698. if key == "e" and attack == false then
  699. bestmates()
  700. end
  701. end)
  702. while true do
  703. swait()
  704. sine = sine + change
  705. local torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  706. local velderp = RootPart.Velocity.y
  707. hitfloor, posfloor = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character)
  708. if attack == true or attack == false then
  709. if attack == false then
  710. idle = idle + 1
  711. else
  712. idle = 0
  713. end
  714. if not (idle >= 500) or attack == false then
  715. end
  716. look = 0
  717. if 1 < RootPart.Velocity.y and hitfloor == nil then
  718. Anim = "Jump"
  719. if attack == false then
  720. change = 1
  721. look = 0
  722. Humanoid.CameraOffset = Vector3.new(0, 0, 0)
  723. Torso.Weld.C0 = clerp(Torso.Weld.C0, CFrame.new(0, -1, -0.15) * CFrame.Angles(math.rad(-13), math.rad(0), math.rad(0)), 0.1)
  724. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(-30 + 2.05 * math.cos(sine / 5)), math.rad(0), math.rad(0)), 0.1)
  725. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-30 + 2.05 * math.cos(sine / 5)), math.rad(0), math.rad(50 - 2.05 * math.cos(sine / 5))), 0.1)
  726. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30 + 2.05 * math.cos(sine / 5)), math.rad(0), math.rad(-50 + 2.05 * math.cos(sine / 5))), 0.1)
  727. if attack == false then
  728. LeftLeg.Weld.C0 = clerp(LeftLeg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-25 + 3.05 * math.cos(sine / 5)), math.rad(0), math.rad(0)), 0.1)
  729. RightLeg.Weld.C0 = clerp(RightLeg.Weld.C0, CFrame.new(0.5, -0.47, -0.7) * CFrame.Angles(math.rad(-12 + 3.05 * math.cos(sine / 5)), math.rad(-3), math.rad(0)), 0.1)
  730. end
  731. end
  732. elseif -1 > RootPart.Velocity.y and hitfloor == nil then
  733. Anim = "Fall"
  734. change = 1
  735. look = 0
  736. if attack == false then
  737. Humanoid.CameraOffset = Vector3.new(0, 0, 0)
  738. Torso.Weld.C0 = clerp(Torso.Weld.C0, CFrame.new(0, -1, 0.2) * CFrame.Angles(math.rad(-10), math.rad(0), math.rad(0)), 0.1)
  739. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(20), math.rad(90)), 0.1)
  740. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(90), math.rad(-20), math.rad(-90)), 0.1)
  741. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(40), math.rad(0), math.rad(0)), 0.1)
  742. end
  743. if attack == false then
  744. LeftLeg.Weld.C0 = clerp(LeftLeg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-8), math.rad(3), math.rad(0)), 0.1)
  745. RightLeg.Weld.C0 = clerp(RightLeg.Weld.C0, CFrame.new(0.5, -0.67, -0.4) * CFrame.Angles(math.rad(25), math.rad(0), math.rad(0)), 0.1)
  746. end
  747. elseif torvel < 1 and hitfloor ~= nil and look <= 800 then
  748. Anim = "Idle"
  749. change = 1.2
  750. if attack == false and equip == false then
  751. Humanoid.CameraOffset = Vector3.new(0, 0, 0)
  752. Torso.Weld.C0 = clerp(Torso.Weld.C0, CFrame.new(0, -1 - 0.04 * math.cos(sine / 40), 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), 0.06)
  753. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(-1 + 2 * math.sin(sine / 40)), math.rad(0), math.rad(0)), 0.06)
  754. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5 + 0.02 * math.sin(sine / 40), 0) * angles(math.rad(0 + 2 * math.cos(sine / 40)), math.rad(0 + 4 * math.sin(sine / 40)), math.rad(2.3 + 0.2 * math.cos(sine / 40))), 0.06)
  755. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5 + 0.02 * math.sin(sine / 40), 0) * angles(math.rad(0 + 2 * math.cos(sine / 40)), math.rad(0 - 4 * math.sin(sine / 40)), math.rad(-2.3 - 0.2 * math.cos(sine / 40))), 0.06)
  756. LeftLeg.Weld.C0 = clerp(LeftLeg.Weld.C0, CFrame.new(-0.5, -1 + 0.04 * math.cos(sine / 40), 0) * CFrame.Angles(math.rad(0), math.rad(2), math.rad(-1)), 0.06)
  757. RightLeg.Weld.C0 = clerp(RightLeg.Weld.C0, CFrame.new(0.5, -1 + 0.04 * math.cos(sine / 40), 0) * CFrame.Angles(math.rad(0), math.rad(-2), math.rad(1)), 0.06)
  758. end
  759. elseif torvel > 2 and torvel < 22 and hitfloor ~= nil then
  760. Anim = "Walk"
  761. change = 0.7
  762. look = 0
  763. if attack == false and equip == false then
  764. Humanoid.CameraOffset = Vector3.new(0, 0, 0)
  765. Torso.Weld.C0 = clerp(Torso.Weld.C0, CFrame.new(0, -1 + 0.14 * math.cos(sine / 5), -0.3) * angles(math.rad(-3 + 2 * math.cos(sine / 5)), math.rad(0 + 2 * math.cos(sine / 10)), math.rad(0) + RootPart.RotVelocity.Y / 46), 0.08)
  766. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0 - 6 * math.sin(sine / 3.5)), math.rad(0), math.rad(0) + RootPart.RotVelocity.Y / 13), 0.08)
  767. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0 + 0.34 * math.sin(sine / 10)) * angles(math.rad(0 - 26 * math.sin(sine / 10)) + RootPart.RotVelocity.Y / -34, math.rad(0), math.rad(2 + 0 * math.sin(sine / 10)) - RootPart.RotVelocity.Y / 34), 0.08)
  768. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0 - 0.34 * math.sin(sine / 10)) * angles(math.rad(0 + 26 * math.sin(sine / 10)) + RootPart.RotVelocity.Y / 34, math.rad(0), math.rad(-2 + 0 * math.sin(sine / 10)) + RootPart.RotVelocity.Y / -34), 0.08)
  769. LeftLeg.Weld.C0 = clerp(LeftLeg.Weld.C0, CFrame.new(-0.5, -1 - 0.21 * math.cos(sine / 10), -0.03 + 0.19 * math.cos(sine / 10)) * CFrame.Angles(math.rad(-8 - 25 * math.sin(sine / 10)), math.rad(0) - RootPart.RotVelocity.Y / -24, math.rad(0) + RootPart.RotVelocity.Y / -34), 0.08)
  770. RightLeg.Weld.C0 = clerp(RightLeg.Weld.C0, CFrame.new(0.5, -1 + 0.21 * math.cos(sine / 10), -0.03 - 0.19 * math.cos(sine / 10)) * CFrame.Angles(math.rad(-8 + 25 * math.sin(sine / 10)), math.rad(0) + RootPart.RotVelocity.Y / 24, math.rad(0) - RootPart.RotVelocity.Y / 34), 0.08)
  771. end
  772. elseif torvel >= 22 and hitfloor ~= nil then
  773. Anim = "Run"
  774. look = 0
  775. change = 0.67 + Character.Humanoid.WalkSpeed / 112
  776. if attack == false and equip == false then
  777. Humanoid.CameraOffset = Vector3.new(0, 0, 0)
  778. Torso.Weld.C0 = clerp(Torso.Weld.C0, CFrame.new(0, -1 - 0.42 * math.cos(sine / 2.5), -0.8) * angles(math.rad(-20), math.rad(0), math.rad(0) + RootPart.RotVelocity.Y / 26), 0.1)
  779. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(-10 + 20 * math.sin(sine / 2.5)), math.rad(0), math.rad(0 + 5 * math.sin(sine / 5)) + RootPart.RotVelocity.Y / 13), 0.1)
  780. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0 + 0.34 * math.sin(sine / 5)) * angles(math.rad(0 - 60 * math.sin(sine / 5)) + RootPart.RotVelocity.Y / -34, math.rad(0), math.rad(4 + 2 * math.sin(sine / 5)) - RootPart.RotVelocity.Y / 34), 0.15)
  781. LW.C0 = clerp(LW.C0, cf(-1.5, 0.5, 0 - 0.34 * math.sin(sine / 5)) * angles(math.rad(0 + 60 * math.sin(sine / 5)) + RootPart.RotVelocity.Y / 34, math.rad(0), math.rad(-4 + 2 * math.sin(sine / 5)) + RootPart.RotVelocity.Y / -34), 0.15)
  782. LeftLeg.Weld.C0 = clerp(LeftLeg.Weld.C0, CFrame.new(-0.5, -1 - 0.24 * math.cos(sine / 5), 0 + 0.24 * math.cos(sine / 5)) * CFrame.Angles(math.rad(-5 - 67 * math.sin(sine / 5)), math.rad(0) + RootPart.RotVelocity.Y / 42, math.rad(0) + RootPart.RotVelocity.Y / -54), 0.3)
  783. RightLeg.Weld.C0 = clerp(RightLeg.Weld.C0, CFrame.new(0.5, -1 + 0.24 * math.cos(sine / 5), 0 - 0.24 * math.cos(sine / 5)) * CFrame.Angles(math.rad(-5 + 67 * math.sin(sine / 5)), math.rad(0) + RootPart.RotVelocity.Y / 42, math.rad(0) - RootPart.RotVelocity.Y / 54), 0.3)
  784. end
  785. if attack == true and noleg == false then
  786. LeftLeg.Weld.C0 = clerp(LeftLeg.Weld.C0, CFrame.new(-0.5, -1 - 0.24 * math.cos(sine / 5), 0 + 0.32 * math.sin(sine / 5)) * CFrame.Angles(math.rad(0 - 65 * math.sin(sine / 5)), math.rad(3), math.rad(0)), 0.2)
  787. RightLeg.Weld.C0 = clerp(RightLeg.Weld.C0, CFrame.new(0.5, -1 + 0.24 * math.cos(sine / 5), 0 - 0.32 * math.sin(sine / 5)) * CFrame.Angles(math.rad(0 + 65 * math.sin(sine / 5)), math.rad(-3), math.rad(0)), 0.2)
  788. end
  789. end
  790. end
  791. if 0 < #Effects then
  792. for e = 1, #Effects do
  793. if Effects[e] ~= nil then
  794. local Thing = Effects[e]
  795. if Thing ~= nil then
  796. local Part = Thing[1]
  797. local Mode = Thing[2]
  798. local Delay = Thing[3]
  799. local IncX = Thing[4]
  800. local IncY = Thing[5]
  801. local IncZ = Thing[6]
  802. if Thing[1].Transparency <= 1 then
  803. if Thing[2] == "Block1" then
  804. Thing[1].CFrame = Thing[1].CFrame * euler(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  805. Mesh = Thing[1]:FindFirstChild("Mesh")
  806. if not Mesh then
  807. Mesh = Instance.new("BlockMesh")
  808. end
  809. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  810. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  811. elseif Thing[2] == "Cylinder" then
  812. Mesh = Thing[1]:FindFirstChild("Mesh")
  813. if not Mesh then
  814. Mesh = Instance.new("BlockMesh")
  815. end
  816. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  817. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  818. elseif Thing[2] == "Blood" then
  819. Mesh = Thing[1]:FindFirstChild("Mesh")
  820. if not Mesh then
  821. Mesh = Instance.new("BlockMesh")
  822. end
  823. Thing[1].CFrame = Thing[1].CFrame * cf(0, 0.5, 0)
  824. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  825. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  826. elseif Thing[2] == "Elec" then
  827. Mesh = Thing[1]:FindFirstChild("Mesh")
  828. if not Mesh then
  829. Mesh = Instance.new("BlockMesh")
  830. end
  831. Mesh.Scale = Mesh.Scale + vt(Thing[7], Thing[8], Thing[9])
  832. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  833. elseif Thing[2] == "Disappear" then
  834. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  835. end
  836. else
  837. Part.Parent = nil
  838. game:GetService("Debris"):AddItem(Part, 0)
  839. table.remove(Effects, e)
  840. end
  841. end
  842. end
  843. end
  844. end
  845. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement