jericoalejo

Yoyo (Roblox Script)

Dec 2nd, 2016
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.83 KB | None | 0 0
  1. --[[
  2. Yoyo script made by Fenrier
  3. ]]
  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. Neck = Torso.Neck
  20. it=Instance.new
  21. vt=Vector3.new
  22. cf=CFrame.new
  23. euler=CFrame.fromEulerAnglesXYZ
  24. angles=CFrame.Angles
  25. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  26. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  27. attack = false
  28. attacktype = 1
  29. damage = 30
  30. oridamage = 20
  31. attackdebounce = false
  32. ssdebounce=false
  33. MMouse=nil
  34. combo=0
  35. GyroNumb=0
  36. cond=nil
  37. --player
  38. player = nil
  39. --save shoulders
  40. RSH, LSH = nil, nil
  41. --welds
  42. RW, LW = Instance.new("Weld"), Instance.new("Weld")
  43. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  44.  
  45.  
  46. if Character:findFirstChild("Yoyo",true) ~= nil then
  47. Character:findFirstChild("Yoyo",true).Parent = nil
  48. end
  49.  
  50.  
  51. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  52. local fp = it("Part")
  53. fp.formFactor = formfactor
  54. fp.Parent = parent
  55. fp.Reflectance = reflectance
  56. fp.Transparency = transparency
  57. fp.CanCollide = false
  58. fp.Locked=true
  59. fp.BrickColor = brickcolor
  60. fp.Name = name
  61. fp.Size = size
  62. fp.Position = Torso.Position
  63. fp.BottomSurface="Smooth"
  64. fp.TopSurface="Smooth"
  65. fp:BreakJoints()
  66. return fp
  67. end
  68.  
  69. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  70. local mesh = it(Mesh)
  71. mesh.Parent = part
  72. if Mesh=="SpecialMesh" then
  73. mesh.MeshType = meshtype
  74. mesh.MeshId = meshid
  75. end
  76. mesh.Offset=offset
  77. mesh.Scale=scale
  78. return mesh
  79. end
  80.  
  81. function weld(parent,part0,part1,c0)
  82. local weld = it("Weld")
  83. weld.Parent = parent
  84. weld.Part0 = part0
  85. weld.Part1 = part1
  86. weld.C0 = c0
  87. return weld
  88. end
  89.  
  90. local modelzorz = Instance.new("Model")
  91. modelzorz.Parent = Character
  92. modelzorz.Name = "Yoyo"
  93.  
  94. local prt1=part(3,modelzorz,0,0,Torso.BrickColor,"Part1",vt(1,1,1))
  95. prt1.CanCollide=true
  96.  
  97. local msh1=mesh("CylinderMesh",prt1,"","",vt(0,0,0),vt(0.4,0.3,0.4))
  98.  
  99. local wld1=weld(prt1,prt1,Torso,euler(1.57,0,0)*cf(-1,1,-0.6))
  100.  
  101. numb=-0.15
  102. for i=1,2 do
  103. local prt2=part(3,modelzorz,0,0,BrickColor.new("Really black"),"Part2",vt(1,1,1))
  104. local msh2=mesh("CylinderMesh",prt2,"","",vt(0,0,0),vt(0.6,0.1,0.6))
  105. local wld2=weld(prt2,prt2,prt1,euler(0,0,0)*cf(0,numb,0))
  106. numb2=0
  107. for i=1,16 do
  108. local prt3=part(3,modelzorz,0.5,0,BrickColor.new("Really black"),"Part3",vt(1,1,1))
  109. local msh3=mesh("SpecialMesh",prt3,"Wedge","",vt(0,0,0),vt(0.05,0.1,0.1))
  110. local wld3=weld(prt3,prt3,prt2,euler(-3.14+0.785,0,1.57)*cf(0,0,0.3))
  111. wld3.C1=euler(0,numb2,0)
  112. --numb2=numb2+0.785
  113. numb2=numb2+0.3925
  114. end
  115. numb=numb+0.3
  116. end
  117.  
  118. local string1=part(3,modelzorz,0,0,BrickColor.new("White"),"String1",vt(1,1,1))
  119. local stringmsh1=mesh("CylinderMesh",string1,"","",vt(0,0,0),vt(0.1,1,0.1))
  120. local stringwld1=weld(string1,string1,prt13,euler(0,0,0)*cf(0,0,0))
  121.  
  122. local strmdl = "Arrow"
  123. coroutine.resume(coroutine.create(function()
  124. repeat
  125. wait(-10)
  126. local top = RightArm.CFrame*cf(0,-1,0)
  127. local bottom = prt1.CFrame
  128. local oristrpos
  129. if strmdl == "Bow" then
  130. oristrpos = CFrame.new((top.p+bottom.p)/2)
  131. elseif strmdl == "Arrow" then
  132. oristrpos = prt1.CFrame
  133. end
  134. local mg1 = (top.p - oristrpos.p).magnitude
  135. local mg2 = (bottom.p - oristrpos.p).magnitude
  136.  
  137. string1.Size = Vector3.new(0.2,mg1,0.2)
  138. string1.Anchored=true
  139. string1.CFrame = CFrame.new((top.p+oristrpos.p)/2,oristrpos.p) * CFrame.Angles(math.rad(90),0,0)
  140.  
  141. --[[
  142. --stringmsh1.Scale=vt(0.1,1,0.1)
  143. stringmsh1.Scale=vt(0.1,mg1,0.1)
  144. --cff=CFrame.new(prt1.CFrame.p,RightArm.Position)*angles(math.rad(90),0,0)*cf(0,-mg1/2,0)
  145. cff=cf(RightArm.CFrame*cf(0,-1,0).p,prt1.Position)*angles(math.rad(90),0,0)*cf(0,-mg1/2,0)
  146. hit2=string1
  147. hit=prt1
  148. stringwld1.Parent=string1
  149. stringwld1.Part0=hit2
  150. stringwld1.Part1=hit
  151. HitPos=cff.p
  152. local CJ = CFrame.new(HitPos)
  153. local C0=cff:inverse() *CJ
  154. local C1=hit.CFrame:inverse() * CJ
  155. stringwld1.C0=C0
  156. stringwld1.C1=C1
  157. ]]
  158. until false
  159. end))
  160.  
  161.  
  162. if (script.Parent.className ~= "HopperBin") then
  163. Tool = Instance.new("HopperBin")
  164. Tool.Parent = Backpack
  165. Tool.Name = "Yoyo"
  166. script.Parent = Tool
  167. end
  168. Bin = script.Parent
  169.  
  170. local bg = it("BodyGyro")
  171. bg.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  172. bg.P = 20e+003
  173. bg.Parent = nil
  174.  
  175. so = function(id,par,vol,pit)
  176. coroutine.resume(coroutine.create(function()
  177. local sou = Instance.new("Sound",par or workspace)
  178. sou.Volume=vol
  179. sou.Pitch=pit or 1
  180. sou.SoundId=id
  181. wait()
  182. sou:play()
  183. wait(6)
  184. sou:Remove()
  185. end))
  186. end
  187.  
  188. function unequipweld()
  189. wld1.Part1=Torso
  190. wld1.C0=euler(1.57,0,0)*cf(-1,1,-0.6)
  191. end
  192.  
  193. function equipweld()
  194. wld1.Part1=RightArm
  195. wld1.C0=euler(0,0,1.57)*cf(0,1.1,0)
  196. end
  197.  
  198. function hideanim()
  199. equipped=false
  200. wait(0.1)
  201. bg.Parent=nil
  202. unequipweld()
  203. end
  204.  
  205. function equipanim()
  206. equipped=true
  207. wait(0.1)
  208. equipweld()
  209. RW.C0=cf(1.5, 0.5, 0) * euler(0,0,0)
  210. RW.C1=cf(0, 0.5, 0) * euler(0,0.2,-0.2)
  211. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  212. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  213. end
  214.  
  215. function MagicCircle(brickcolor,cframe,x1,y1,z1,x2,y2,z2,x3,y3,z3)
  216. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  217. prt.Anchored=true
  218. prt.CFrame=cframe*cf(x2,y2,z2)
  219. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  220. coroutine.resume(coroutine.create(function()
  221. for i=0,1,0.1 do
  222. wait()
  223. prt.CFrame=prt.CFrame
  224. prt.Transparency=i
  225. msh.Scale=msh.Scale+vt(x3,y3,z3)
  226. end
  227. prt.Parent=nil
  228. end))
  229. end
  230.  
  231. function SpecialEffect()
  232. local prt=part(3,workspace,1,0,BrickColor.new("Really black"),"Part",vt(1,1,1))
  233. prt.Anchored=true
  234. prt.CFrame=Torso.CFrame
  235. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(0.5,0.5,0.5))
  236. coroutine.resume(coroutine.create(function(Part,Mesh)
  237. for i=0,1,0.2 do
  238. wait(0)
  239. Part.Transparency=i
  240. Mesh.Scale=Mesh.Scale+vt(10,10,10)
  241. end
  242. prt.Parent=nil
  243. end),prt,msh)
  244. end
  245.  
  246. Damagefunc1=function(hit,Damage,Knockback)
  247. if hit.Parent==nil then
  248. return
  249. end
  250. CPlayer=Bin
  251. h=hit.Parent:FindFirstChild("Humanoid")
  252. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  253. if attackdebounce == false then
  254. attackdebounce = true
  255. coroutine.resume(coroutine.create(function()
  256. wait(0.2)
  257. attackdebounce = false
  258. end))
  259. Damage=Damage
  260. --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
  261. return
  262. end]]
  263. -- hs(hit,1.2)
  264. c=Instance.new("ObjectValue")
  265. c.Name="creator"
  266. c.Value=game.Players.LocalPlayer
  267. c.Parent=h
  268. game:GetService("Debris"):AddItem(c,.5)
  269. Damage=Damage+math.random(50,60)
  270. -- h:TakeDamage(Damage)
  271. h.Health=h.Health-Damage
  272. showDamage(hit.Parent,Damage,.5)
  273. vp=Instance.new("BodyVelocity")
  274. vp.P=500
  275. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  276. -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
  277. vp.velocity=Head.CFrame.lookVector*Knockback+Head.Velocity/1.05
  278. if Knockback>0 then
  279. vp.Parent=hit.Parent.Torso
  280. end
  281. rl=Instance.new("BodyAngularVelocity")
  282. rl.P=3000
  283. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  284. rl.angularvelocity=Vector3.new(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  285. -- rl.Parent=hit
  286. coroutine.resume(coroutine.create(function(vel)
  287. wait(1)
  288. vel:Remove()
  289. end),rl)
  290. game:GetService("Debris"):AddItem(vp,.25)
  291. game:GetService("Debris"):AddItem(r,.5)
  292. c=Instance.new("ObjectValue")
  293. c.Name="creator"
  294. c.Value=Player
  295. c.Parent=h
  296. game:GetService("Debris"):AddItem(c,.5)
  297. CRIT=false
  298. hitDeb=true
  299. AttackPos=6
  300. end
  301. end
  302. end
  303.  
  304. Damagefunc2=function(hit,Damage,Knockback)
  305. if hit.Parent==nil then
  306. return
  307. end
  308. CPlayer=Bin
  309. blocked=false
  310. h=hit.Parent:FindFirstChild("Humanoid")
  311. if h~=nil and hit.Parent:FindFirstChild("Torso")~=nil then
  312. Damage=Damage
  313. c=it("ObjectValue")
  314. c.Name="creator"
  315. c.Value=game.Players.LocalPlayer
  316. c.Parent=h
  317. game:GetService("Debris"):AddItem(c,.5)
  318. -- print(c.Value)
  319. --[[ if math.random(0,99)+math.random()<=7.8 then
  320. CRIT=true
  321. Damage=Damage*2
  322. s=it("Sound")
  323. s.SoundId="http://www.roblox.com/asset/?id=2801263"
  324. s.Volume=1
  325. s.Pitch=2
  326. s.Parent=hit
  327. s.PlayOnRemove=true
  328. s.Parent=nil
  329.  
  330. end]]
  331. Damage=Damage+math.random(0,10)
  332. -- Blood(hit.CFrame*cf(math.random(-10,10)/10,math.random(-10,10)/10,0),math.floor(Damage/2))
  333. block=hit.Parent:findFirstChild("Block")
  334. if block~=nil then
  335. print("herp")
  336. if block.Value>0 then
  337. blocked=true
  338. block.Value=block.Value-3
  339. print(block.Value)
  340. end
  341. end
  342. if blocked==false then
  343. -- h:TakeDamage(Damage)
  344. h.Health=h.Health-Damage
  345. showDamage(hit.Parent,Damage,.5)
  346. else
  347. h:TakeDamage(1)
  348. showDamage(hit.Parent,1,.5)
  349. end
  350. --if blocked==false then
  351. --end
  352. local bodyVelocity=Instance.new("BodyVelocity")
  353. bodyVelocity.velocity=angle*40+Vector3.new(0,0,0)
  354. bodyVelocity.P=5000
  355. bodyVelocity.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  356. bodyVelocity.Parent=hit
  357. coroutine.resume(coroutine.create(function(Vel)
  358. wait(1)
  359. Vel:Remove()
  360. end),bodyVelocity)
  361. game:GetService("Debris"):AddItem(vp,1)
  362. c=it("ObjectValue")
  363. c.Name="creator"
  364. c.Value=Player
  365. c.Parent=h
  366. game:GetService("Debris"):AddItem(c,.5)
  367. CRIT=false
  368. hitDeb=true
  369. AttackPos=6
  370. end
  371. end
  372.  
  373. showDamage=function(Char,Dealt,du)
  374. m=Instance.new("Model")
  375. m.Name=tostring(Dealt)
  376. h=Instance.new("Humanoid")
  377. h.Health=0
  378. h.MaxHealth=0
  379. h.Parent=m
  380. c=Instance.new("Part")
  381. c.Transparency=0
  382. c.BrickColor=BrickColor:Red()
  383. if CRIT==true then
  384. c.BrickColor=BrickColor.new("Really red")
  385. end
  386. c.Name="Head"
  387. c.TopSurface=0
  388. c.BottomSurface=0
  389. c.formFactor="Plate"
  390. c.Size=Vector3.new(1,.4,1)
  391. ms=Instance.new("CylinderMesh")
  392. ms.Scale=Vector3.new(.8,.8,.8)
  393. if CRIT==true then
  394. ms.Scale=Vector3.new(1,1.25,1)
  395. end
  396. ms.Parent=c
  397. c.Reflectance=0
  398. Instance.new("BodyGyro").Parent=c
  399. c.Parent=m
  400. c.CFrame=CFrame.new(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  401. f=Instance.new("BodyPosition")
  402. f.P=2000
  403. f.D=100
  404. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  405. f.position=c.Position+Vector3.new(0,3,0)
  406. f.Parent=c
  407. game:GetService("Debris"):AddItem(m,.5+du)
  408. c.CanCollide=false
  409. m.Parent=workspace
  410. c.CanCollide=false
  411. end
  412.  
  413. local function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  414. return game.Workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  415. end
  416.  
  417. function oneslash()
  418. attack=true
  419. for i=0,1,0.1 do
  420. wait()
  421. Neck.C0=necko*euler(0,0,0.785*i)
  422. RW.C0=cf(1.5, 0.5, 0) * euler(-0.5*i,0,0)
  423. end
  424. for i=0,1,0.2 do
  425. wait()
  426. offset=(Torso.Position.y-MMouse.Hit.p.y)/60
  427. mag=(Torso.Position-MMouse.Hit.p).magnitude/80
  428. offset=offset/mag
  429. Neck.C0=necko*euler(0,0,0.785-2.355*i)
  430. RW.C0=cf(1.5, 0.5, 0) * euler(-0.5+0.5*i,0,-offset)
  431. RW.C1=cf(0, 0.5, 0) * euler(0,0.2-0.2*i,-0.2-1.37*i)
  432. end
  433. wait(0.2)
  434. so("http://roblox.com/asset/?id=10209640",LeftArm,1,1)
  435. prt1.Velocity=vt(0,0,0)
  436. wld1.Parent=nil
  437. local baseprt=part(3,workspace,0,1,BrickColor.new("Black"),"BasePart",vt(1,1,1))
  438. --[[local hit,pos = rayCast(prt1.Position,MMouse.Hit.p,100,game)
  439. local hit,pos = game.Workspace:FindPartOnRay(Ray.new(prt1.Position, MMouse.Hit.p.unit * (100)), workspace)
  440. print(pos)
  441. print(hit)
  442. baseprt.CFrame=CFrame.new(pos)]]
  443. baseprt.CFrame=RightArm.CFrame*cf(0,-70,0)
  444. fd=Instance.new("BodyPosition")
  445. fd.P=200
  446. fd.D=60
  447. fd.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  448. fd.position=baseprt.Position
  449. fd.Parent=prt1
  450. coroutine.resume(coroutine.create(function(BodyPos)
  451. while fd.Parent~=nil do
  452. wait()
  453. so("http://roblox.com/asset/?id=10209640",prt1,0.4,3)
  454. end
  455. end),fd)
  456. con1=prt1.Touched:connect(function(hit)
  457. if hit==baseprt then
  458. coroutine.resume(coroutine.create(function(BodyPos)
  459. for i=1,20 do
  460. wait(0)
  461. BodyPos.position=RightArm.Position
  462. end
  463. end),fd)
  464. con1:disconnect()
  465. con2=prt1.Touched:connect(function(hit)
  466. if hit==RightArm then
  467. fd.Parent=nil
  468. wld1.Parent=RightArm
  469. wld1.C0=euler(0,0,1.57)*cf(0,1.1,0)
  470. con2:disconnect()
  471. end
  472. end)
  473. end
  474. end)
  475. cond=prt1.Touched:connect(function(hit) Damagefunc1(hit,10,20) end)
  476. wait(0.5)
  477. coroutine.resume(coroutine.create(function(BodyPos)
  478. for i=1,20 do
  479. wait(0)
  480. BodyPos.position=RightArm.Position
  481. end
  482. end),fd)
  483. wait(1)
  484. cond:disconnect()
  485. fd.Parent=nil
  486. wld1.Parent=RightArm
  487. wld1.C0=euler(0,0,1.57)*cf(0,1.1,0)
  488. baseprt.Parent=nil
  489. attack=false
  490. end
  491.  
  492. function YoyoGrab()
  493. attack=true
  494. for i=0,1,0.1 do
  495. wait()
  496. Neck.C0=necko*euler(0,0,0.785*i)
  497. RW.C0=cf(1.5, 0.5, 0) * euler(-0.5*i,0,0)
  498. end
  499. for i=0,1,0.2 do
  500. wait()
  501. offset=(Torso.Position.y-MMouse.Hit.p.y)/60
  502. mag=(Torso.Position-MMouse.Hit.p).magnitude/80
  503. offset=offset/mag
  504. Neck.C0=necko*euler(0,0,0.785-2.355*i)
  505. RW.C0=cf(1.5, 0.5, 0) * euler(-0.5+0.5*i,0,-offset)
  506. RW.C1=cf(0, 0.5, 0) * euler(0,0.2-0.2*i,-0.2-1.37*i)
  507. end
  508. wait(0.2)
  509. so("http://roblox.com/asset/?id=10209640",LeftArm,1,1)
  510. prt1.Velocity=vt(0,0,0)
  511. wld1.Parent=nil
  512. local baseprt=part(3,workspace,0,1,BrickColor.new("Really black"),"BasePart",vt(1,1,1))
  513. --[[local hit,pos = rayCast(prt1.Position,MMouse.Hit.p,100,game)
  514. local hit,pos = game.Workspace:FindPartOnRay(Ray.new(prt1.Position, MMouse.Hit.p.unit * (100)), workspace)
  515. print(pos)
  516. print(hit)
  517. baseprt.CFrame=CFrame.new(pos)]]
  518. baseprt.CFrame=RightArm.CFrame*cf(0,-200,0)
  519. fd=Instance.new("BodyPosition")
  520. fd.P=200
  521. fd.D=60
  522. fd.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  523. fd.position=baseprt.Position
  524. fd.Parent=prt1
  525. coroutine.resume(coroutine.create(function(BodyPos)
  526. while fd.Parent~=nil do
  527. wait()
  528. so("http://roblox.com/asset/?id=10209640",prt1,0.4,3)
  529. end
  530. end),fd)
  531. coroutine.resume(coroutine.create(function()
  532. wait(0.1)
  533. con1=prt1.Touched:connect(function(hit)
  534. if hit.Name~="String1" then
  535. fd.Parent=nil
  536. prt1.Anchored=true
  537. fddd=Instance.new("BodyPosition")
  538. fddd.P=2000
  539. fddd.D=600
  540. fddd.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  541. fddd.position=prt1.Position
  542. fddd.Parent=RightArm
  543. coroutine.resume(coroutine.create(function(BodyPos)
  544. wait(1)
  545. prt1.Anchored=false
  546. wld1.Parent=RightArm
  547. wld1.C0=euler(0,0,1.57)*cf(0,1.1,0)
  548. BodyPos.Parent=nil
  549. end),fddd)
  550. end
  551. end)
  552. end))
  553. cond=prt1.Touched:connect(function(hit) Damagefunc1(hit,10,20) end)
  554. wait(2)
  555. con1:disconnect()
  556. coroutine.resume(coroutine.create(function(BodyPos)
  557. for i=1,20 do
  558. wait(0)
  559. BodyPos.position=RightArm.Position
  560. end
  561. end),fd)
  562. wait(1)
  563. cond:disconnect()
  564. fd.Parent=nil
  565. wld1.Parent=RightArm
  566. wld1.C0=euler(0,0,1.57)*cf(0,1.1,0)
  567. baseprt.Parent=nil
  568. attack=false
  569. end
  570.  
  571. function ob1d(mouse)
  572. if attack == true then return end
  573. attack=true
  574. coroutine.resume(coroutine.create(function()
  575. bg.maxTorque = vt(math.huge,math.huge,math.huge)
  576. bg.P = 9000
  577. bg.Parent = Torso
  578. --wld1.C0 = euler(0,0,0) * cf(0,0,0)
  579. while attack==true do
  580. wait()
  581. local pos4 = vt(workspace.CurrentCamera.CoordinateFrame.X,Head.Position.Y,workspace.CurrentCamera.CoordinateFrame.Z)
  582. bg.cframe = cf(Head.Position,pos4) * euler(0,3.14+GyroNumb,0) * cf(0,0,0) --cf(Torso.Position,MMouse.Hit.p) *
  583. bg.Parent = Head
  584. local pos5 = Vector3.new(MMouse.Hit.p.x,Head.Position.Y,MMouse.Hit.p.z)
  585. offset=(Torso.Position.y-MMouse.Hit.p.y)/60
  586. mag=(Torso.Position-MMouse.Hit.p).magnitude/80
  587. offset=offset/mag
  588. --[[Neck.C0=necko*euler(0,0,0)
  589. RW.C0=cf(1.5, 0.5, 0) * euler(0,0,0)
  590. RW.C1=cf(0, 0.5, 0) * euler(0,0.2,-0.2)
  591. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  592. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)]]
  593. end
  594. for i=0,1,0.1 do
  595. wait()
  596. Neck.C0=necko*euler(0,0,0)
  597. Neck.C1=necko2*euler(0,0,0)
  598. RW.C0=cf(1.5, 0.5, 0) * euler(0,0,0)
  599. RW.C1=cf(0, 0.5, 0) * euler(0,0.2,-0.2)
  600. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  601. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  602. bg.Parent=nil
  603. end
  604. end))
  605. hold=true
  606. oneslash()
  607. --twoslash()
  608. end
  609.  
  610. function ob1u(mouse)
  611. hold = false
  612.  
  613. end
  614.  
  615. buttonhold = false
  616.  
  617. eul=0
  618. function key(key)
  619. if attack == true then return end
  620. if key=="z" or key=="x" or key=="c" or key=="v" then
  621. coroutine.resume(coroutine.create(function()
  622. bg.maxTorque = vt(math.huge,math.huge,math.huge)
  623. bg.P = 9000
  624. bg.Parent = Torso
  625. --wld1.C0 = euler(0,0,0) * cf(0,0,0)
  626. attack=true
  627. while attack==true do
  628. wait()
  629. local pos4 = vt(workspace.CurrentCamera.CoordinateFrame.X,Head.Position.Y,workspace.CurrentCamera.CoordinateFrame.Z)
  630. bg.cframe = cf(Head.Position,pos4) * euler(0,3.14+GyroNumb,0) * cf(0,0,0) --cf(Torso.Position,MMouse.Hit.p) *
  631. bg.Parent = Head
  632. local pos5 = Vector3.new(MMouse.Hit.p.x,Head.Position.Y,MMouse.Hit.p.z)
  633. offset=(Torso.Position.y-MMouse.Hit.p.y)/60
  634. mag=(Torso.Position-MMouse.Hit.p).magnitude/80
  635. offset=offset/mag
  636. --[[Neck.C0=necko*euler(0,0,0)
  637. RW.C0=cf(1.5, 0.5, 0) * euler(0,0,0)
  638. RW.C1=cf(0, 0.5, 0) * euler(0,0.2,-0.2)
  639. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  640. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)]]
  641. end
  642. for i=0,1,0.1 do
  643. wait()
  644. Neck.C0=necko*euler(0,0,0)
  645. Neck.C1=necko2*euler(0,0,0)
  646. RW.C0=cf(1.5, 0.5, 0) * euler(0,0,0)
  647. RW.C1=cf(0, 0.5, 0) * euler(0,0.2,-0.2)
  648. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  649. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  650. bg.Parent=nil
  651. end
  652. end))
  653. end
  654. if key=="z" then
  655. YoyoGrab()
  656. end
  657. if key=="x" then
  658. --SonicExplosion()
  659. end
  660. if key=="c" then
  661. end
  662. end
  663.  
  664. function key2(key)
  665.  
  666. end
  667.  
  668. function s(mouse)
  669. mouse.Button1Down:connect(function() ob1d(mouse) end)
  670. mouse.Button1Up:connect(function() ob1u(mouse) end)
  671. mouse.KeyDown:connect(key)
  672. mouse.KeyUp:connect(key2)
  673. unsheathed = true
  674. player = Player
  675. ch = Character
  676. MMouse = mouse
  677. RSH = ch.Torso["Right Shoulder"]
  678. LSH = ch.Torso["Left Shoulder"]
  679. --
  680. RSH.Parent = nil
  681. LSH.Parent = nil
  682. --
  683. RW.Part0 = ch.Torso
  684. RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  685. RW.C1 = CFrame.new(0, 0.5, 0)
  686. RW.Part1 = ch["Right Arm"]
  687. RW.Parent = ch.Torso
  688. --_G.R = RW
  689. --
  690. LW.Part0 = ch.Torso
  691. LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  692. LW.C1 = CFrame.new(0, 0.5, 0)
  693. LW.Part1 = ch["Left Arm"]
  694. LW.Parent = ch.Torso
  695. --_G.L = LW
  696. --
  697. equipanim()
  698. end
  699.  
  700. function ds(mouse)
  701. hideanim()
  702. wait(0)
  703. RW.Parent = nil
  704. LW.Parent = nil
  705. RSH.Parent = player.Character.Torso
  706. LSH.Parent = player.Character.Torso
  707. end
  708.  
  709. Bin.Selected:connect(s)
  710. Bin.Deselected:connect(ds)
  711. print("Yoyo loaded.")
Add Comment
Please, Sign In to add comment