Advertisement
Rblx__Scripts

The Yoyo ROBLOX Script

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