codemen

Conrollable yoyo script [roblox]

Nov 13th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.77 KB | None | 0 0
  1. --[[SCRIPT NAME]]--
  2. --[[
  3.  
  4. Move List
  5.  
  6.  
  7. --]]
  8. local plr = game.Players.LocalPlayer
  9. local char = plr.Character
  10. local mouse = plr:GetMouse()
  11. local torso = char.Torso
  12. local rs = torso["Right Shoulder"]
  13. local ls = torso["Left Shoulder"]
  14. local rh = torso["Right Hip"]
  15. local lh = torso["Left Hip"]
  16. local rj = char.HumanoidRootPart.RootJoint
  17. local neck = torso.Neck
  18. local animpose = "Idle"
  19. local attacking = false
  20. local cananim = true
  21. local rage = false
  22. local shield = nil
  23. local sprint = false
  24. local canrage = true
  25. local legs = false
  26. local trail = false
  27. local powers = false
  28. local bc = char:WaitForChild("Body Colors")
  29. local multiplier = 1
  30. local lac = char["Body Colors"].LeftArmColor
  31. local rac = char["Body Colors"].RightArmColor
  32. local rlc = char["Body Colors"].RightArmColor
  33. local llc = char["Body Colors"].LeftLegColor
  34. local hc = char["Body Colors"].HeadColor
  35. local tc = char["Body Colors"].TorsoColor
  36. local humanoid = char:FindFirstChildOfClass("Humanoid")
  37. local huge = Vector3.new(math.huge,math.huge,math.huge)
  38. local mobs = Instance.new("Sound", char)
  39. mobs.SoundId = "rbxassetid://soundid"
  40. mobs.Looped = true
  41. mobs.Volume = 3
  42. mobs:Play()
  43. if char:FindFirstChild("Animate") then char.Animate:Destroy() end
  44. if char:FindFirstChildOfClass("Humanoid"):FindFirstChild("Animator") then char:FindFirstChildOfClass("Humanoid").Animator:Destroy() end
  45. function legsonly()
  46. spawn(function()
  47. for i = 0, 10 do
  48. wait(0.001)
  49. if attacking then break end
  50. end
  51. if not attacking then
  52. legs = false
  53. end
  54. end)
  55. end
  56. function swait(t)
  57. if t == nil or t == 0 then
  58. game:service('RunService').Stepped:wait(0)
  59. return true
  60. else
  61. for i = 0, t do
  62. game:service('RunService').Stepped:wait(0)
  63. end
  64. return true
  65. end
  66. end
  67. function hurt(hit, dmg)
  68. if hit.Parent then
  69. if hit.Parent:IsA("LocalScript") then hit.Parent:Destroy() end
  70. local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  71. if hum then
  72. if hum.Parent.Name ~= plr.Name then
  73. if dmg == "Kill" or hum.Health > 100000 then
  74. hit.Parent:BreakJoints()
  75. return true
  76. else
  77. if math.random(0, 100) == 50 then
  78. hum.Health = hum.Health - dmg*multiplier*2.5
  79. else
  80. hum.Health = hum.Health -dmg*multiplier
  81. end
  82. return true
  83. end
  84. end
  85. end
  86. end
  87. end
  88. function soundeffect(id, volume, speed, parent)
  89. spawn(function()
  90. local s = Instance.new("Sound")
  91. s.SoundId = id
  92. s.Volume = volume
  93. s.PlaybackSpeed = speed
  94. s.Parent = parent
  95. s:Play()
  96. repeat wait() until not s.Playing
  97. s:Destroy()
  98. end)
  99. end
  100. function gethum(obj)
  101. if obj.Parent then
  102. if obj.Parent:FindFirstChild("Humanoid") then
  103. if obj.Parent.Name ~= plr.Name then
  104. return obj.Parent:FindFirstChildOfClass("Humanoid")
  105. end
  106. end
  107. end
  108. end
  109. function smooth(obj)
  110. local sides = {"Left", "Right", "Top", "Bottom", "Front", "Back"}
  111. for i,v in pairs(sides) do
  112. obj[v.."Surface"] = "SmoothNoOutlines"
  113. end
  114. end
  115. function getparent()
  116. local par = workspace:FindFirstChild("BasePlate")
  117. if not par then par = workspace:FindFirstChild("Base") end
  118. if not par then par = char.Head end
  119. return par
  120. end
  121. function fade(obj, dest, grow)
  122. spawn(function()
  123. local oldcf = obj.CFrame
  124. for i = 0, 10 do
  125. if grow then
  126. obj.Size = obj.Size +Vector3.new(1,1,1)
  127. obj.CFrame = oldcf
  128. end
  129. obj.Transparency = obj.Transparency +0.1
  130. swait()
  131. end
  132. if dest then
  133. obj:Destroy()
  134. end
  135. end)
  136. end
  137. function replacejoint(name)
  138. local j = torso:FindFirstChild(name)
  139. if not j then j = char.HumanoidRootPart:FindFirstChild(name) end
  140. if j then
  141. if true then
  142. local new = Instance.new("Weld")
  143. new.Part0 = j.Part0
  144. j.Part0 = nil
  145. new.Name = j.Name.." Replacement"
  146. new.Parent = j.Parent
  147. new.Part1 = j.Part1
  148. new.C0 = j.C0
  149. new.C1 = j.C1
  150. return new
  151. end
  152. end
  153. end
  154. function removejoint(name)
  155. local j = torso:FindFirstChild(name.." Replacement")
  156. if not j then j = char.HumanoidRootPart:FindFirstChild(name.." Replacement") end
  157. if j then
  158. local p0 = j.Part0
  159. local c0 = j.C0
  160. local c1 = j.C1
  161. j:Destroy()
  162. local new = p0:FindFirstChild(name)
  163. local ac0 = new.C0
  164. local ac1 = new.C1
  165. new.Part0 = p0
  166. new.C0 = c0
  167. new.C1 = c1
  168. spawn(function()
  169. for i = 0, 1, 0.1 do
  170. new.C0 = new.C0:Lerp(ac0, 0.7)
  171. new.C1 = new.C1:lerp(ac1, 0.7)
  172. wait()
  173. end
  174. end)
  175. end
  176. end
  177. function fixalljoints()
  178. for i,v in pairs({"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}) do
  179. removejoint(v)
  180. end
  181. end
  182. function getnewjoints()
  183. local rs = replacejoint("Right Shoulder")
  184. local ls = replacejoint("Left Shoulder")
  185. local rh = replacejoint("Right Hip")
  186. local lh = replacejoint("Left Hip")
  187. local neck = replacejoint("Neck")
  188. local rj = replacejoint("RootJoint")
  189. return rs,ls,rh,lh,neck,rj
  190. end
  191. function chargegui()
  192. local gui = Instance.new("ScreenGui")
  193. gui.Name = "Charge"
  194. item1 = Instance.new('TextLabel')
  195. item1.Active = false
  196. item1.AnchorPoint = Vector2.new(0, 0)
  197. item1.BackgroundColor3 = Color3.new(1, 1, 1)
  198. item1.BackgroundTransparency = 1
  199. item1.BorderColor3 = Color3.new(0.105882, 0.164706, 0.207843)
  200. item1.BorderSizePixel = 1
  201. item1.Name = [[TextLabel]]
  202. item1.Position = UDim2.new(0,620,0,11)
  203. item1.Rotation = 0
  204. item1.Selectable = false
  205. item1.Size = UDim2.new(0,204,0,25)
  206. item1.SizeConstraint = Enum.SizeConstraint.RelativeXY
  207. item1.Visible = true
  208. item1.ZIndex = 1
  209. item1.ClipsDescendants = false
  210. item1.Draggable = false
  211. item1.Font = Enum.Font.SourceSansLight
  212. item1.FontSize = Enum.FontSize.Size24
  213. item1.Text = [[Charge Level]]
  214. item1.TextColor3 = Color3.new(0, 0, 0)
  215. item1.TextScaled = false
  216. item1.TextSize = 24
  217. item1.TextStrokeColor3 = Color3.new(0, 0, 0)
  218. item1.TextStrokeTransparency = 1
  219. item1.TextTransparency = 0
  220. item1.TextWrapped = false
  221. item1.TextXAlignment = Enum.TextXAlignment.Center
  222. item1.TextYAlignment = Enum.TextYAlignment.Center
  223. item1.Parent = gui
  224. item2 = Instance.new('Frame')
  225. item2.Active = false
  226. item2.AnchorPoint = Vector2.new(0, 0)
  227. item2.BackgroundColor3 = Color3.new(0, 0.760784, 0.0470588)
  228. item2.BackgroundTransparency = 0
  229. item2.BorderColor3 = Color3.new(0.105882, 0.164706, 0.207843)
  230. item2.BorderSizePixel = 0
  231. item2.Name = [[Bar]]
  232. item2.Position = UDim2.new(0,566,0,49)
  233. item2.Rotation = 0
  234. item2.Selectable = false
  235. item2.Size = UDim2.new(0,312,0,55)
  236. item2.SizeConstraint = Enum.SizeConstraint.RelativeXY
  237. item2.Visible = true
  238. item2.ZIndex = 2
  239. item2.ClipsDescendants = false
  240. item2.Draggable = false
  241. item2.Parent = gui
  242. item3 = Instance.new('Frame')
  243. item3.Active = false
  244. item3.AnchorPoint = Vector2.new(0, 0)
  245. item3.BackgroundColor3 = Color3.new(0, 0, 0)
  246. item3.BackgroundTransparency = 0
  247. item3.BorderColor3 = Color3.new(0.105882, 0.164706, 0.207843)
  248. item3.BorderSizePixel = 0
  249. item3.Name = [[Frame]]
  250. item3.Position = UDim2.new(0,561,0,45)
  251. item3.Rotation = 0
  252. item3.Selectable = false
  253. item3.Size = UDim2.new(0,322,0,54)
  254. item3.SizeConstraint = Enum.SizeConstraint.RelativeXY
  255. item3.Visible = true
  256. item3.ZIndex = 1
  257. item3.ClipsDescendants = false
  258. item3.Draggable = false
  259. item3.Parent = gui
  260. gui.Parent = plr.PlayerGui
  261. return gui
  262. end
  263. local keyamount = 0
  264. mouse.KeyDown:connect(function(key)
  265. if key == "w" or key == "a" or key == "s" or key == "d" then
  266. keyamount = keyamount + 1
  267. if animpose ~= "Falling" then
  268. animpose = "Walking"
  269. if keyamount > 3 then keyamount = 0 end
  270. end
  271. end
  272. end)
  273. mouse.KeyUp:connect(function(key)
  274. if key == "w" or key == "a" or key == "s" or key == "d" then
  275. keyamount = keyamount - 1
  276. if keyamount < 0 then keyamount = 0 end
  277. if keyamount == 0 then
  278. animpose = "Idle"
  279. end
  280. end
  281. end)
  282. local model = Instance.new("Model")
  283. model.Name = "YOYO"
  284. item1 = Instance.new('Part')
  285. item1.BrickColor = BrickColor.new('Really black')
  286. item1.Material = Enum.Material.Plastic
  287. item1.Reflectance = 0
  288. item1.Transparency = 0
  289. item1.Name = 'Part1'
  290. item1.Anchored = false
  291. item1.CanCollide = true
  292. item1.Locked = true
  293. item1.Size = Vector3.new(0.299999982, 1.10000002, 1.10000002) smooth(item1)
  294. item1.Parent = model
  295. item2 = Instance.new('Part')
  296. item2.BrickColor = BrickColor.new('Crimson')
  297. item2.Material = Enum.Material.Neon
  298. item2.Reflectance = 0
  299. item2.Transparency = 0
  300. item2.Name = 'Handle'
  301. item2.Anchored = false
  302. item2.CanCollide = true
  303. item2.Locked = true
  304. item2.Size = Vector3.new(0.299999982, 0.700000048, 0.700000048) smooth(item2)
  305. item2.Parent = model
  306. item3 = Instance.new('Part')
  307. item3.BrickColor = BrickColor.new('Really black')
  308. item3.Material = Enum.Material.Plastic
  309. item3.Reflectance = 0
  310. item3.Transparency = 0
  311. item3.Name = 'Part2'
  312. item3.Anchored = false
  313. item3.CanCollide = true
  314. item3.Locked = true
  315. item3.Size = Vector3.new(0.299999982, 1.10000002, 1.10000002) smooth(item3)
  316. item3.Parent = model
  317. item4 = Instance.new('Weld')
  318. item4.Name = 'Weld'
  319. item4.Part0 = model.Part1
  320. item4.Part1 = model.Handle
  321. item4.C0 = CFrame.new(-55.2500038, -0.0500000007, -54.4500008, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  322. item4.C1 = CFrame.new(-55.5500031, -0.0500000007, -54.4500008, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  323. item4.Parent = model.Part1
  324. item5 = Instance.new('Weld')
  325. item5.Name = 'Weld'
  326. item5.Part0 = model.Part2
  327. item5.Part1 = model.Part1
  328. item5.C0 = CFrame.new(-55.8500023, -0.0500000007, -54.4500008, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  329. item5.C1 = CFrame.new(-55.2500038, -0.0500000007, -54.4500008, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  330. item5.Parent = model.Part2
  331. item6 = Instance.new('SpecialMesh')
  332. item6.Name = 'Mesh'
  333. item6.MeshType = Enum.MeshType.Cylinder
  334. item6.MeshId = ''
  335. item6.Scale = Vector3.new(1, 1, 1)
  336. item6.Parent = model.Part1
  337. item7 = Instance.new('SpecialMesh')
  338. item7.Name = 'Mesh'
  339. item7.MeshType = Enum.MeshType.Cylinder
  340. item7.MeshId = ''
  341. item7.Scale = Vector3.new(1, 1, 1)
  342. item7.Parent = model.Handle
  343. item8 = Instance.new('SpecialMesh')
  344. item8.Name = 'Mesh'
  345. item8.MeshType = Enum.MeshType.Cylinder
  346. item8.MeshId = ''
  347. item8.Scale = Vector3.new(1, 1, 1)
  348. item8.Parent = model.Part2
  349. model.Parent = char
  350. local handle = model.Handle
  351. local handlew = Instance.new("Weld")
  352. handlew.Part0 = handle
  353. handlew.Part1 = char["Right Arm"]
  354. handlew.C1 = CFrame.new(0,-1,0)
  355. handlew.Parent = handle
  356. for i,v in pairs(model:children()) do
  357. v.CustomPhysicalProperties = PhysicalProperties.new(0,0,0,0,0)
  358. end
  359.  
  360. local gdown = false
  361. local tdown = false
  362. mouse.KeyDown:connect(function(key)
  363. if key == "g" and not attacking and not gdown then
  364. local rs = replacejoint("Right Shoulder")
  365. local ls = replacejoint("Left Shoulder")
  366. local rj = replacejoint("RootJoint")
  367. gdown = true
  368. attacking = true
  369. local gui = chargegui()
  370. local bar = gui.Bar
  371. local power = 0
  372. repeat swait()
  373. power = power + 5
  374. if power > 312 then power = 312 end
  375. bar.Size = UDim2.new(0,(power/312)*312,0,55)
  376. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.156434491, -0.987688541, 0, 0.987688541, 0.156434491, 1, 0, 0), 0.2)
  377. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -0.00657593738, -0.199269861, 0.979922593, -0.590055168, 0.791935623, 0.157082453, -0.807337344, -0.577175498, -0.122787893), 0.2)
  378. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.987688661, -0.156434506, 0, 0, 0, 1, -0.156434506, 0.987688661, 0), 0.2)
  379. until not gdown
  380. gui:Destroy()
  381. for i = 0, 2, 0.1 do
  382. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.0523359701, -0.998629749, 0, 0.998629749, 0.0523359701, 1, 0, 0), 0.2)
  383. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -0.128450975, 0.152486846, 0.979922593, 0.968406498, -0.193699107, 0.157082453, 0.213763118, 0.969141543, -0.122787893), 0.2)
  384. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.992546797, 0.1218694, 0, 0, 0, 1, 0.1218694, 0.992546797, 0), 0.2)
  385. if i == 0.5 then
  386. handlew.Part0 = nil
  387. local bv = Instance.new("BodyVelocity")
  388. bv.MaxForce = huge
  389. bv.Velocity = CFrame.new(handle.Position, mouse.Hit.p).lookVector*(power*0.5)
  390. bv.Parent = handle
  391. game.Debris:AddItem(bv, 0.1)
  392. local con
  393. local w
  394. con = handle.Touched:connect(function(hit)
  395. if hurt(hit, 10) then
  396. con:disconnect()
  397. w = Instance.new("Weld")
  398. w.Part0 = hit
  399. w.Part1 = handle
  400. w.C0 = hit.CFrame:inverse()
  401. w.C1 = handle.CFrame:inverse()
  402. w.Parent = hit
  403. end
  404. end)
  405. local num = 0
  406. repeat swait()
  407. trail = true
  408. num = num + 1
  409. until num >= 100 or w
  410. if not w then con:disconnect() end
  411. handlew.C0 = CFrame.new(0,0,0)
  412. handlew.C1 = CFrame.new(0,-1,0)
  413. local cf = handle.CFrame
  414. for i = 1, 20 do
  415. handle.Anchored = false
  416. handle.CFrame = cf:Lerp(char["Right Arm"].CFrame *CFrame.new(0,-1,0), i/20)
  417. handle.Anchored = true
  418. swait()
  419. end
  420. if w then w:Destroy() end
  421. handle.Anchored = false
  422. trail = false
  423. handlew.Part0 = handle
  424. end
  425. swait()
  426. end
  427.  
  428. attacking = false
  429. fixalljoints()
  430. end
  431. if key == "f" and not attacking then
  432. attacking = true
  433. humanoid.WalkSpeed = 0
  434. local touch = false
  435. local num = 0
  436. local parts = {}
  437. local last = char.Torso.CFrame *CFrame.new(0,-3,0)
  438. local lastscale = 1.5
  439. local x,z = 0,0
  440. local udown = false
  441. handlew.Part0 = nil
  442. local con = mouse.KeyDown:connect(function(key)
  443. if key == "w" then
  444. z = z + -2
  445. udown = true
  446. end
  447. if key == "a" then
  448. x = x + -0.3
  449. end
  450. if key == "d" then
  451. x = x + 0.3
  452. end
  453. end)
  454. local con2 = mouse.KeyUp:connect(function(key)
  455. if key == "w" then
  456. udown = false
  457. z = z - -2
  458. end
  459. if key == "a" then
  460. x = x - -0.3
  461. end
  462. if key == "d" then
  463. x = x - 0.3
  464. end
  465. end)
  466. local dir = char.Torso.CFrame.lookVector
  467. local o = workspace.CurrentCamera.CameraType
  468. handle.Anchored = true
  469. repeat swait()
  470. local start = last *CFrame.new(0,0,-lastscale/2)
  471. local thing = false
  472. if z == 0 then
  473. z = -2
  474. thing = true
  475. end
  476. local finish = last *CFrame.new(x,0,z)
  477. local mag = (start.p-finish.p).magnitude
  478. num = num + 1
  479. local p = Instance.new("Part")
  480. p.Size = Vector3.new(1,0.2,mag)
  481. p.Name = "cool looking line that is just for looks"
  482. p.Anchored = true
  483. p.BrickColor = BrickColor.new("Crimson")
  484. p.Material = "Neon"
  485. smooth(p)
  486. p.CFrame = CFrame.new(start.p, finish.p)
  487. p.CFrame = p.CFrame *CFrame.new(0,0,-mag/2)
  488. handle.Anchored = false
  489. handle.CFrame = p.CFrame *CFrame.new(0.3,0,0)
  490. handle.Anchored = true
  491. last = p.CFrame
  492. lastscale = mag
  493. local m = Instance.new("SpecialMesh")
  494. m.MeshType = "Brick"
  495. m.Parent = p
  496. p.Touched:connect(function(hit)
  497. if hurt(hit, 200) then
  498. touch = true
  499. local p1 = Instance.new("Part")
  500. soundeffect("rbxassetid://636458264", 2, 1, p1)
  501. p1.Anchored = true
  502. p1.CanCollide = false
  503. p1.BrickColor = BrickColor.new("Crimson")
  504. p1.Material = "Neon"
  505. p1.Name = "omega ex-u-plosion"
  506. p1.CFrame = p.CFrame
  507. p1.Size = Vector3.new(0.2,0.2,0.2)
  508. p1.Transparency = 1
  509. local m = Instance.new("SpecialMesh")
  510. m.MeshType = "Sphere"
  511. m.Parent = p1
  512. p1.Parent = getparent()
  513. local sub = -0.1
  514. for i = 1, 30 do
  515. if i >= 15 then sub = 0.1 end
  516. p1.Transparency = p1.Transparency + sub
  517. local cf = p1.CFrame
  518. p1.Size = p1.Size:Lerp(Vector3.new(10,10,10),0.2)
  519. p1.CFrame = cf
  520. swait()
  521. end
  522. p1:Destroy()
  523. end
  524. end)
  525. table.insert(parts, p)
  526. p.Parent = getparent()
  527. workspace.CurrentCamera.CameraType = "Scriptable"
  528. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:Lerp(p.CFrame *CFrame.new(0,2,2),0.5)
  529. if thing then
  530. z = 0 thing = false
  531. end
  532. until touch or num == 500
  533. handle.Anchored = false
  534. local cf = handle.CFrame
  535. for i = 1, 40 do
  536. handle.Anchored = false
  537. handle.CFrame = cf:Lerp(char["Right Arm"].CFrame *CFrame.new(0,-1,0), i/20)
  538. handle.Anchored = true
  539. swait()
  540. end
  541. handle.Anchored = false
  542. handlew.Part0 = handle
  543. workspace.CurrentCamera.CameraType = o
  544. for i = 0, 1, 0.1 do
  545. for i,v in pairs(parts) do
  546. v.Mesh.Scale = v.Mesh.Scale:Lerp(Vector3.new(0,1,1),0.3)
  547. end
  548. swait()
  549. end
  550. for i,v in pairs(parts) do
  551. v:Destroy()
  552. end
  553. humanoid.WalkSpeed = 16
  554. attacking = false
  555. end
  556. if key == "y" and not attacking then
  557. attacking = true
  558. local rs = replacejoint("Right Shoulder")
  559. local ls = replacejoint("Left Shoulder")
  560. local rj = replacejoint("RootJoint")
  561. local num = 0
  562. for i = 0, 2, 0.1 do
  563. handlew.C1 = handlew.C1:Lerp(CFrame.new(0,-4,0), 0.2)
  564. ls.C0 = ls.C0:Lerp(CFrame.new(-0.754648447, 0.476126075, -0.315012902, -0.0523041263, -0.613378763, -0.788055778, -0.998022199, 0.0596848764, 0.0197843909, 0.0348996557, 0.78753221, -0.615287662), 0.2)
  565. rs.C0 = rs.C0:Lerp(CFrame.new(0.759603679, 0.487401366, -0.319454879, -0.0523360372, 0.600990534, 0.797541499, 0.99863106, 0.0314966701, 0.0417973027, -9.12696123e-008, 0.798637211, -0.601816177), 0.2)
  566. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), 0.2)
  567. swait()
  568. end
  569. trail = true
  570. local connection = handle.Touched:connect(function(hit)
  571. hurt(hit, math.random(20,50))
  572. end)
  573. for i = 0, 150 do
  574. if i%20 == 0 then soundeffect("rbxassetid://541909867", 2, 2, handle) end
  575. rj.C0 = rj.C0:Lerp(rj.C0*CFrame.Angles(0,0,math.rad(4*(i/2))), 0.2)
  576. swait()
  577. end
  578. trail = false
  579. attacking = false
  580. connection:disconnect()
  581. fixalljoints()
  582. handlew.C1 = CFrame.new(0,-1,0)
  583. end
  584. if key == "t" and not attacking and not tdown then
  585. tdown = true
  586. attacking = true
  587. local rs = replacejoint("Right Shoulder")
  588. handlew.C0 = CFrame.new(3,0,0)
  589. local power = 0
  590. trail = true
  591. local cons = {}
  592. for i,v in pairs(handle.Parent:children()) do
  593. local con = v.Touched:connect(function(hit)
  594. hurt(hit, 10)
  595. end)
  596. table.insert(cons, con)
  597. end
  598. repeat swait()
  599. power = power + 5
  600. if power >= 180 then power = 180 end
  601. rs.C0 = rs.C0:Lerp(CFrame.new(1.52548289, 0.0268524922, 0, 0, -0.998630881, -0.0523358211, 0, -0.0523358211, 0.998630881, -1, 0, 0), 0.2)
  602. handlew.C1 = handlew.C1 *CFrame.Angles(0,math.rad((power/180)*20),0)
  603. until not tdown
  604. handlew.Part0 = nil
  605. local bv = Instance.new("BodyVelocity")
  606. bv.MaxForce = huge
  607. bv.Velocity = CFrame.new(handle.Position, mouse.Hit.p).lookVector*power
  608. bv.Parent = handle
  609. game.Debris:AddItem(bv, 0.1)
  610. fixalljoints()
  611. swait(100)
  612. for i,v in pairs(cons) do
  613. v:disconnect()
  614. end
  615. local cf = handle.CFrame
  616. for i = 1, 20 do
  617. handle.Anchored = false
  618. handle.CFrame = cf:Lerp(char["Right Arm"].CFrame *CFrame.new(0,-1,0), i/20)
  619. handle.Anchored = true
  620. swait()
  621. end
  622. handle.Anchored = false
  623. handlew.C1 = CFrame.new(0,-1,0)
  624. handlew.C0 = CFrame.new(0,0,0)
  625. trail = false
  626. handlew.Part0 = handle
  627. attacking = false
  628. end
  629. end)
  630. mouse.KeyUp:connect(function(key)
  631. if key == "g" and attacking then
  632. gdown = false
  633. end
  634. if key == "t" and attacking then
  635. tdown = false
  636. end
  637. end)
  638. local parts = {}
  639. spawn(function()
  640. local num = 0
  641. local lastpart = nil
  642. local lastscale = 0.5
  643. local cf = handle.CFrame
  644. while swait() do
  645. for i,v in pairs(parts) do
  646. if v:FindFirstChild("Mesh") then
  647. v.Mesh.Scale = v.Mesh.Scale:Lerp(Vector3.new(0,0,1), 0.2)
  648. if v.Mesh.Scale.X < 0.05 then
  649. v:Destroy()
  650. end
  651. end
  652. end
  653. if trail and handle.CFrame ~= cf then
  654. if not lastpart then lastpart = handle end
  655. local start = lastpart.CFrame *CFrame.new(0,0,-lastscale/2)
  656. local endpos = handle.CFrame
  657. local mag = (start.p-endpos.p).magnitude
  658. local p = Instance.new("Part")
  659. p.Anchored = true
  660. p.BrickColor = BrickColor.new("Crimson")
  661. p.Material = "Neon"
  662. p.CanCollide = false
  663. p.Size = Vector3.new(0.5,0.5,mag)
  664. p.CFrame = CFrame.new(start.p, endpos.p)*CFrame.new(0,0,-mag/2)
  665. local m = Instance.new("SpecialMesh")
  666. m.MeshType = "Brick"
  667. m.Parent = p
  668. p.Parent = getparent()
  669. table.insert(parts, p)
  670. cf = handle.CFrame
  671. lastscale = mag
  672. lastpart = p
  673. else
  674. if lastpart then
  675. lastpart:Destroy()
  676. lastpart = nil
  677. lastscale = 0.5
  678. end
  679. end
  680. local v = char.HumanoidRootPart.Velocity
  681. if v.Y > 15 then
  682. animpose = "Jump"
  683. end
  684. if v.Y < -15 then
  685. animpose = "Falling"
  686. end
  687. if math.abs(v.X)+math.abs(v.Z) >=10 and v.Y == 0 then
  688. animpose = "Walking"
  689. end
  690. if math.abs(v.X)+v.Y+math.abs(v.Z) <= 9 and v.Y == 0 then
  691. animpose = "Idle"
  692. end
  693. end
  694. end)
  695. local num = 0
  696. while swait() do
  697. num = num + 0.05
  698. local sin = math.sin(num)
  699. if animpose == "Walking" and cananim then
  700. for i = 0, 1.5, 0.1 do
  701. if animpose == "Walking" and cananim then
  702. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0.0406726934, 0.0329360999, -0.99862957, 0.776081443, 0.62845856, 0.0523359552, 0.629320979, -0.777146459, 0), 0.2)
  703. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -0.0388932228, -0.0350196026, 0.998629689, 0.742127001, 0.668214321, 0.0523359627, -0.66913116, 0.743145287, 0), 0.2)
  704. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, 0.024677692, 0.0246776957, -0.999390841, 0.706676483, 0.706676781, 0.0348994955, 0.707107425, -0.707107246, 0), 0.2)
  705. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -0.0136363264, -0.032125175, 0.999390841, 0.390493214, 0.919944584, 0.0348994955, -0.920505524, 0.390731305, 0), 0.2)
  706. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), 0.2)
  707. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.99969542, -0.0174524058, 0.0174497478, 0.0174524058, 0, 0.99984771, -0.0174497478, 0.99984771, 0.000304586458), 0.2)
  708. swait()
  709. else
  710. break
  711. end
  712. end
  713. for i = 0, 1.5, 0.1 do
  714. if animpose == "Walking" and cananim then
  715. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -0.0433885492, 0.0292659476, -0.99862957, -0.827903032, 0.558427453, 0.0523359552, 0.559194028, 0.829038858, 0), 0.2)
  716. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, 0.0400917344, -0.0336409658, 0.998629689, -0.764996171, 0.641907811, 0.0523359627, -0.642788768, -0.76604563, 0), 0.2)
  717. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -0.0163843632, 0.0308145005, -0.999390841, -0.469186544, 0.882411182, 0.0348994955, 0.882949054, 0.469472289, 0), 0.2)
  718. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, 0.0246777162, -0.0246777181, 0.999390841, -0.70667702, 0.70667696, 0.0348994955, -0.707107902, -0.707107782, 0), 0.2)
  719. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), 0.2)
  720. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.999695539, 0.0174497515, -0.0174524095, -0.0174497515, 0.000304586574, 0.999847829, 0.0174524058, 0.99984771, -2.90993982e-11), 0.2)
  721. swait()
  722. else
  723. break
  724. end
  725. end
  726. end
  727. if animpose == "Idle" and cananim then
  728. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.0523359552, -0.99862957, 0, 0.99862957, 0.0523359552, 1, 0, 0)*CFrame.new(0,sin/30,0)*CFrame.Angles(math.rad(sin*3),0,0), 0.2)
  729. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, 0, -0.0523359552, 0.99862957, 0, 0.99862957, 0.0523359552, -1, -0, 0)*CFrame.new(0,sin/30,0)*CFrame.Angles(math.rad(sin*3),0,0), 0.2)
  730. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, 0, 0.0348994955, -0.999390841, 0, 0.999390841, 0.0348994955, 1, 0, 0), 0.2)
  731. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, 0, -0.0348994955, 0.999390841, 0, 0.999390841, 0.0348994955, -1, 0, 0), 0.2)
  732. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -0.994522035, -0.104528472, 0, 0, 0, 1, -0.104528472, 0.994522035, 0), 0.2)
  733. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.997564137, 0.0697564781, 0, 0, 0, 1, 0.0697564781, 0.997564137, 0), 0.2)
  734. swait()
  735. end
  736. if animpose == "Jump" and cananim then
  737. for i = 0, 0.8, 0.1 do
  738. if animpose == "Jump" and cananim then
  739. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.121869355, -0.99254632, 0, 0.99254632, 0.121869355, 1, 0, 0), 0.2)
  740. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, 0, -0.104528472, 0.994522035, 0, 0.994522035, 0.104528472, -1, -0, 0), 0.2)
  741. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -0.499999911, -0.5, 0, 0, -1, 0.309017062, 0.951056957, 0, 0.951056957, -0.309017062, 0), 0.2)
  742. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, 0, 0, 1, -0.121869355, 0.99254632, 0, -0.99254632, -0.121869355, 0), 0.2)
  743. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), 0.2)
  744. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), 0.2)
  745. swait()
  746. else
  747. break
  748. end
  749. end
  750. end
  751. if animpose == "Falling" and cananim then
  752. ls.C0 = ls.C0:Lerp(CFrame.new(-0.987813056, 0.599254608, 0, 0, 0.121869355, -0.99254632, 0, 0.99254632, 0.121869355, 1, 0, 0), 0.2)
  753. rs.C0 = rs.C0:Lerp(CFrame.new(0.986082673, 0.599026859, 0, 0, -0.139173135, 0.990268409, 0, 0.990268409, 0.139173135, -1, 0, 0), 0.2)
  754. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -0.963904023, 0.0336604826, 0, 0.104528472, -0.994522035, 0.0697564557, 0.992099881, 0.1042739, 0.997564554, -0.0693743229, -0.00729153492), 0.2)
  755. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, 0, -0.0697564781, 0.997564137, -0.121869355, 0.990128577, 0.0692365244, -0.99254632, -0.121572495, -0.00850117672), 0.2)
  756. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0.13917312, 0.99026823, 0, 0.99026823, -0.13917312), 0.2)
  757. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), 0.2)
  758. end
  759. end
Add Comment
Please, Sign In to add comment