nicholasXPG

Untitled

Sep 27th, 2016
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.08 KB | None | 0 0
  1. if not Workspace:FindFirstChild'TheGamer101' then ---I sometimes test weapon in studio, so I use a dummy
  2. ply=game.Players.LocalPlayer
  3. char=ply.Character
  4. Name = 'Magnam'
  5. pcall(function() ply.Backpack[Name]:Destroy() end) --- Destroys Tool
  6. hop = Instance.new("HopperBin",ply.Backpack)
  7. hop.Name = Name
  8. else
  9. char=Workspace.TheGamer101
  10. end
  11. torso=char.Torso
  12. local ccam = Workspace.CurrentCamera
  13. rarm=char['Right Arm']
  14. larm=char['Left Arm']
  15. bcol=BrickColor.new
  16. cfn,md,mr=CFrame.new,math.rad,math.random
  17. ang=function(x,y,z)return CFrame.Angles(x or 0,y or 0,z or 0)end
  18. Debris=game:service'Debris'
  19. m={}
  20. RS=game:service'RunService'
  21. m.tau=math.pi*2
  22. m.floatforce = 196.25
  23.  
  24. function genNew(ClassName, Parent, Properties)
  25. local nObj = Instance.new(ClassName, Parent)
  26. if Properties["FormFactor"] then
  27. nObj["FormFactor"] = Properties["FormFactor"]
  28. end
  29. for Prop, Value in pairs(Properties) do
  30. nObj[Prop] = Value
  31. end
  32. return nObj
  33. end
  34. rw,rw2,lw,lw2=nil,nil,nil,nil
  35.  
  36. function l(a,x,y,z,xx,yy,zz)
  37. if string.find(tostring(a),',') == nil then
  38. return (a.CFrame*CFrame.new(x or 0,y or 0,z or 0))*CFrame.Angles(xx or 0,yy or 0, zz or 0)
  39. else return (a * CFrame.new(x or 0,y or 0,z or 0))*CFrame.Angles(xx or 0,yy or 0,zz or 0)
  40. end
  41. end
  42.  
  43. tw = function(Weld, Stop, Step,a) --- TweenWeld function
  44. local func = function(w)
  45. local Start = w.C1
  46. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  47. local Stop = Stop
  48. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  49.  
  50. for i = 0, 1, Step or .1 do
  51. w.C1 = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i),
  52. (Start.p.Y * (1 - i)) + (Stop.p.Y * i),
  53. (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  54. (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i),
  55. (Z1 * (1 - i)) + (Z2 * i) )
  56. wait()
  57. end
  58.  
  59. w.C1 = Stop
  60. end
  61. if type(Weld)=='table'then
  62. for i=1,#Weld do
  63. if i < #Weld then
  64. coroutine.wrap(function()func(Weld[i])end)()
  65. else
  66. func(Weld[i])
  67. end
  68. end
  69. else
  70. if a then coroutine.wrap(function() func(Weld) end)() else func(Weld) end
  71. end
  72. end
  73. tc = function(Part, Stop, Step,a) --- TweenCFrame function
  74. local func = function()
  75. local Start = Part.CFrame
  76. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  77. local Stop = Stop
  78. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  79.  
  80. for i = 0, 1, Step or .1 do
  81. Part.CFrame = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i),
  82. (Start.p.Y * (1 - i)) + (Stop.p.Y * i),
  83. (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  84. (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i),
  85. (Z1 * (1 - i)) + (Z2 * i) )
  86. wait()
  87. end
  88.  
  89. Part.CFrame = Stop
  90. end
  91. if a then coroutine.wrap(function() func() end)() else func() end
  92. end
  93. Lock = function(which) --- For using Animation
  94. local result = {rw=false,lw=false}
  95. if which == 'R' then
  96. if not rw then
  97. rabr = Part(1,1,1,'White',0) rabr.Transparency = 1
  98. rabr.Position = torso.Position
  99. rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = Weapon
  100. w = Instance.new("Weld",Weapon)
  101. w.Part0,w.Part1 = char['Right Arm'],rabr
  102. w.C1 = CFrame.new(0,-.5,0)
  103. else
  104. rabr:Destroy()
  105. rw = nil
  106. end
  107. elseif which == 'L' then
  108. if not lw then
  109. labr = Part(1,1,1,'White',0) labr.Transparency = 1
  110. labr.Position = torso.Position
  111. lw = Weld(labr,torso,-1.5,.5,0,0,0,0) lw.Parent = Weapon
  112. w = Instance.new("Weld",Weapon)
  113. w.Part0,w.Part1 = char['Left Arm'],labr
  114. w.C1 = CFrame.new(0,-.5,0)
  115. else
  116. labr:Destroy()
  117. lw = nil
  118. end
  119. elseif which == 'RR' then
  120. if not rw2 then
  121. rlbr = Part(1,1,1,'White',0) rlbr.Transparency = 1
  122. rlbr.Position = torso.Position
  123. rw2 = Weld(rlbr,torso,.5,-1.5,0,0,0,0) rw2.Parent = Weapon rw2.Name = 'rw2'
  124. w = Instance.new("Weld",Weapon)
  125. w.Part0,w.Part1 = char['Right Leg'],rlbr
  126. w.C1 = CFrame.new(0,-.5,0)
  127. else
  128. rlbr:Destroy()
  129. rw2 = _
  130. end
  131. elseif which == 'LL' then
  132. if not lw2 then
  133. llbr = Part(1,1,1,'White',0) llbr.Transparency = 1
  134. llbr.Position = torso.Position
  135. lw2 = Weld(llbr,torso,-.5,-1.5,0,0,0,0) lw2.Parent = Weapon lw2.Name = 'lw2'
  136. w = Instance.new("Weld",Weapon)
  137. w.Part0,w.Part1 = char['Left Leg'],llbr
  138. w.C1 = CFrame.new(0,-.5,0)
  139. else
  140. llbr:Destroy()
  141. lw2 = _
  142. end
  143. elseif which == nil then
  144. if rw then result.rw = true end
  145. if lw then result.lw = true end
  146. if rw2 then result.rw = true end
  147. if lw2 then result.lw = true end
  148. end
  149. return result
  150. end
  151.  
  152. function findHum(a)local res=nil
  153. for i,v in pairs(a:children())do
  154. if v:IsA'Humanoid'and v.Parent~=char then
  155. res=v
  156. end
  157. end
  158. return res
  159. end
  160.  
  161. function udim(a,b,a2,b2)
  162. if type(a)=='string'then
  163. local x,y=a:match('(%d+%.*%d*)%,*(%d+%.*%d*)')
  164. return UDim2.new(tonumber(x) or 0,0,tonumber(y) or 0,0)
  165. else
  166. return UDim2.new(a or 0,a2 or 0,b or 0,b2 or 0)
  167. end
  168. end
  169.  
  170. function Damage(hum,amount,func,time)
  171. local found=hum.Parent:FindFirstChild'M_D'
  172. local h_head=hum.Parent:FindFirstChild'Head'
  173. if not found then
  174. local bbg=genNew('BillboardGui',hum.Parent,{
  175. --Size=udim(0,0,100,50);
  176. Size = UDim2.new(0,100,0,50);
  177. Adornee=h_head;
  178. StudsOffset=Vector3.new(0,5,0);
  179. Name='M_D';
  180.  
  181. })
  182. local fr=genNew('Frame',bbg,{
  183. Size=udim'1,1';
  184. Position=udim'0,1';
  185. BackgroundTransparency=1;
  186. })
  187. local img=genNew('ImageLabel',fr,{
  188. Size=udim'1,1';
  189. Image='http://www.roblox.com/asset/?id=185395810';
  190. BackgroundTransparency=1;
  191. })
  192. local text=genNew('TextLabel',fr,{
  193. TextScaled=true;
  194. Text=amount;
  195. Size=udim'1,1';
  196. TextColor3=bcol'Bright red'.Color;
  197. BackgroundTransparency=1;
  198. })
  199. hum:TakeDamage(amount)
  200. fr:TweenPosition(udim'0,0','Out','Quad',time or 1,false)
  201. if func then func()end
  202. for i=0,time or 1,.1 do img.ImageTransparency=i text.TextTransparency=i wait()end bbg:Destroy()
  203. end
  204. end
  205.  
  206.  
  207. pcall(function() char.Sole3:Destroy() end) --- Destroys Physical Tool
  208. Weapon = Instance.new("Model",char) Weapon.Name = 'Sole3'
  209.  
  210. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
  211. p0.Position = p1.Position
  212. local w = Instance.new('Motor',par or p0)
  213. w.Part0 = p1
  214. w.Part1 = p0
  215. w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0)
  216. -- w.MaxVelocity = .1
  217. return w
  218. end
  219. Cur_Parent=nil
  220. current_mat=nil
  221.  
  222. Part = function(x,y,z,color,tr,cc,an,parent)
  223. local p = Instance.new('Part',parent or cur_Parent or Weapon)
  224. p.formFactor = 'Custom'
  225. p.Locked = true
  226. p.Size = Vector3.new(x,y,z)
  227. p.BrickColor = BrickColor.new(color or 'White')
  228. p.CanCollide = cc or false
  229. p.Anchored = an or false
  230. p.Transparency = tr or 0
  231. p.Material=current_mat or'SmoothPlastic'
  232. for i,v in pairs{'TopSurface','BottomSurface','FrontSurface','BackSurface','LeftSurface','RightSurface'}do
  233. p[v]=10
  234. end
  235. return p
  236. end
  237.  
  238. Wedge = function(x,y,z,color,tr,cc,an,parent)
  239. local p = Instance.new('WedgePart',parent or Weapon)
  240. p.formFactor = 'Custom'
  241. p.Size = Vector3.new(x,y,z)
  242. p.BrickColor = BrickColor.new(color or 'White')
  243. p.CanCollide = cc or false
  244. p.Anchored = an or false
  245. p.Transparency = tr or 0
  246. p.Material=current_mat or'SmoothPlastic'
  247. for i,v in pairs{'TopSurface','BottomSurface','FrontSurface','BackSurface','LeftSurface','RightSurface'}do
  248. p[v]=10
  249. end
  250. return p
  251. end
  252. function l(a,x,y,z,xx,yy,zz)
  253. if string.find(tostring(a),',') == nil then
  254. return (a.CFrame*CFrame.new(x or 0,y or 0,z or 0))*CFrame.Angles(xx or 0,yy or 0, zz or 0)
  255. else return (a * CFrame.new(x or 0,y or 0,z or 0))*CFrame.Angles(xx or 0,yy or 0,zz or 0)
  256. end
  257. end
  258. function beam(a,b,s)
  259. local mag = (a-b).magnitude
  260. local laz = Part(s or 1,mag,s or 1)
  261. laz.CFrame = (cfn(a,b)*cfn(0,0,-mag/2))*ang(math.pi/2,0,0)
  262. end
  263.  
  264. Add ={ --- Array for handy functions
  265. BG = function(parent)
  266. local bg = Instance.new("BodyGyro",parent)
  267. bg.P = 20e+003
  268. bg.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  269. return bg
  270. end;
  271. BP = function(parent,position)
  272. local bp = Instance.new("BodyPosition",parent)
  273. bp.maxForce = Vector3.new()*math.huge
  274. bp.position = position or parent.Position
  275. return bp
  276. end;
  277. BV = function(parent,force)
  278. local bv = Instance.new("BodyVelocity",parent)
  279. bv.maxForce = Vector3.new()*math.huge
  280. bv.velocity = force or Vector3.new(0,0,0)
  281. return bv
  282. end;
  283. Sound = function(id,pitch,loop,parent)
  284. local tab = {}
  285. local snd = Instance.new("Sound",parent or char.Head)
  286. snd.Name = 'MugSound'
  287. snd.SoundId = id
  288. snd.Volume = 100
  289. snd.Pitch = pitch or 1
  290. snd.Looped=loop and true or false
  291. tab.Sound = snd
  292. function tab:Play()self.Sound:Play()end
  293. function tab:Stop()self.Sound:Stop()end
  294. function tab:Pitch(a)self.Sound.Pitch = a end
  295. function tab:Volume(a)self.Sound.Volume = a end
  296. setmetatable(tab,{
  297. __call = function(t,param) local cl = t.Sound:Clone() cl.Parent = param return cl end;
  298. })
  299. return tab
  300. end;
  301. Fire = function(parent,size,heat,color,color2)
  302. local f = Instance.new("Fire",parent)
  303. f.Size = size
  304. f.Heat = heat
  305. f.Color = BrickColor.new(color).Color
  306. if color2 then
  307. f.SecondaryColor = BrickColor.new(color2).Color
  308. end
  309. return f
  310. end;
  311. }
  312.  
  313.  
  314. Meshes = {Diamond='rbxassetid://9756362';Spikeball='rbxassetid://9982590';Table='rbxassetid://111868131';---MeshIds
  315. Egg='rbxassetid://1527559';Ring='rbxassetid://3270017';Bullet='rbxassetid://2697549';Grass='rbxassetid://1080954';
  316. Shark='rbxassetid://82821384';Sword='rbxassetid://12221720';Crown='rbxassetid://10688643'}
  317. Mesh = function(par,num,x,y,z,tex)
  318. local msh = _
  319. if num == 1 then msh = Instance.new("CylinderMesh",par)
  320. elseif num == 2 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 3
  321. elseif num == 3 then msh = Instance.new("BlockMesh",par)
  322. elseif num == 4 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 'Wedge'
  323. elseif type(num) == 'string' then msh = Instance.new("SpecialMesh",par)
  324. msh.MeshId = string.find(num,'://') == nil and Meshes[num] or num
  325. msh.TextureId = tex and tex or ''
  326. end
  327. msh.Scale = Vector3.new(x or 1,y or 1,z or 1)
  328. return msh
  329. end
  330.  
  331. hdl=Part(.25,2.5,.25)Mesh(hdl,1)
  332. hw=Weld(hdl,rarm,0,-1.05,0,math.pi/2)
  333.  
  334. function gZ(a)
  335. obj,opt=a:match('(%w+)%,*(%w*)')
  336. for i,v in pairs(getfenv())do
  337. if i==obj then
  338. obj=v
  339. end
  340. end
  341. if opt~='' then
  342. return obj.Size[opt]
  343. else
  344. return obj.Size.x,obj.Size.y,obj.Size.z
  345. end
  346. end
  347. col='White'
  348. spinning_parts={}
  349. fires={}
  350. swords={}
  351. for _,ao in pairs{{gZ'hdl,y'/2+.1,0,0},{-(gZ'hdl,y'/2+.1),math.pi,math.pi}}do --- this loop makes curves
  352. for angle=-math.pi/6,math.pi/6,math.pi/6 do
  353. prev=Part(.2,.2,.2,'Cyan',.5)Mesh(prev,2,2,2,2)
  354. Weld(prev,hdl,0,ao[1],0,angle,ao[2],ao[3])
  355. for i=0,8 do
  356. if i%2==0 then col='Black'else col='White'end
  357. p=Part(.1,.2,.1,col)Mesh(p,1)
  358.  
  359. Weld(p,prev,0,p.Size.y/2+prev.Size.y/2,0,md'5')
  360. if i==8 then p.BrickColor=bcol'Bright red'Mesh(p,2).Scale=Vector3.new(3,3,3)table.insert(spinning_parts,p.Motor)
  361. local f=Add.Fire(p,0,0,'Cyan','White')f.Enabled=false table.insert(fires,f)
  362. prev=p
  363. cur=prev
  364. for o=0,m.tau,m.tau/10 do
  365. p2=Part(.1,.1,.1,'New Yeller',1)Mesh(p2,'Sword',.2,.2,.1)
  366. p2.Material='Ice'
  367. w=Weld(p2,cur,math.cos(o)*.5,0,math.sin(o)*.5,math.pi/2,0,math.pi/2+o)
  368. w.C1=w.C1*ang(-math.pi/2,0,md'80')
  369. table.insert(swords,p2)
  370. end
  371. end
  372. prev=p
  373. end
  374. end
  375. end
  376.  
  377. rwC0={eq=cfn()*ang(md'5',0,md'-25')}
  378. lwC0={eq=cfn(0,.6,0)*ang(md'-70',md'50')}
  379. hwC1={arm=cfn(0,-1.05,0)*ang(math.pi/2),torso=(cfn(0,0,.75)*ang(0,0,md'-135'))*ang(0,math.pi/2)}
  380.  
  381. metacross={
  382. __call=function(tab,a)return tab[a]end;
  383. }
  384.  
  385. Keys={}
  386. for i,v in pairs{rwC0,lwC0,hwC1}do setmetatable(v,metacross)end
  387. hw.Part0,hw.Part1=torso,hdl
  388. hw.C0=hwC1'torso'
  389.  
  390. Equip=function()
  391. hw.Part0=rarm
  392. hw.C0=hwC1'arm'
  393. Lock'R' tw(rw,rwC0'eq')
  394. for i=1,#fires do fires[i].Enabled=true end
  395. for i=1,.5,-.1 do
  396. for _,v in pairs(swords)do
  397. v.Transparency=i
  398. end
  399. wait()
  400. end
  401. end
  402. Unequip=function()
  403. tw(rw,cfn())for i=1,#fires do fires[i].Enabled=false end
  404. for i=.5,1,.1 do
  405. for _,v in pairs(swords)do
  406. v.Transparency=i
  407. end
  408. wait()
  409. end
  410. Lock'R'
  411. hw.Part0=torso
  412. hw.C0=hwC1'torso'
  413. end
  414.  
  415. snd=Add.Sound("http://www.roblox.com/Asset/?id=16433289",1)
  416. ding_snd=Add.Sound("http://www.roblox.com/Asset/?id=19344667",1)
  417. damSnd=Add.Sound("http://www.roblox.com/Asset/?id=24902512",2)
  418. sword_wave=function() --shoots sword
  419. tw(rw,cfn()*ang(md'-90',md'-45')) snd:Play()
  420. tw(rw,cfn()*ang(md'20',0,md'-45'),.3)
  421.  
  422. local function onTouch(hit)
  423. local hum=findHum(hit.Parent)
  424. if hum then
  425. Damage(hum,10,function()
  426. dsnd=damSnd(hum.Torso)dsnd:Play()Debris:AddItem(dsnd,1)end,.05)
  427. end
  428. end
  429.  
  430. local function fade(a,msh)
  431. local orig=msh.Scale
  432. for i=0,1,.1 do
  433. msh.Scale=orig-Vector3.new(i*orig.x,i*orig.y,i*orig.z)
  434. a.Transparency=.5+(i/2)
  435. wait()
  436. end
  437.  
  438. end
  439. local function spread(obj)
  440. for o=md'-45',md'45',md'90' do
  441. local cl2=Part(2,2,3.8*2,'New Yeller',.5)cl2:BreakJoints()
  442. local msh22=Mesh(cl2,'Sword',2,2,2)
  443. Instance.new('Sparkles',cl2).SparkleColor=bcol'Bright red'.Color
  444.  
  445. cl2.CFrame=l(obj,0,0,0,math.pi,o)*cfn(0,0,4)
  446. cl2.Touched:connect(function(hit)onTouch(hit)end)
  447. Add.BV(cl2,cl2.CFrame.lookVector*-100)
  448. Debris:AddItem(cl2,1)
  449. Delay(.5,function()coroutine.wrap(fade)(cl2,msh22)wait(.5)
  450.  
  451. end)
  452. end
  453. end
  454. for o=md'-45',md'45',md'45' do
  455. local sword=Part(2,2,3.8*2,'New Yeller',.5)sword:BreakJoints()
  456. local sfx=Part(1,1,1,'New Yeller')sfx.Anchored=true
  457. sfx.CFrame=l(torso,0,0,-5)
  458. local msh=Mesh(sfx,'Ring')---ring effect
  459. Spawn(function()
  460. for i=.1,1,.05 do
  461. msh.Scale=Vector3.new(i*10,i*10,1)
  462. sfx.Transparency=i
  463. wait()
  464. end sfx:Destroy()
  465. end)
  466. sword.Touched:connect(onTouch)
  467. local msh2=Mesh(sword,'Sword',2,2,2)
  468. sword.CFrame=l(l(torso,0,0,0,0,o),0,0,-5)
  469. Add.BV(sword,sword.CFrame.lookVector*75)
  470. local orig=msh2.Scale ---the starting size
  471. -- Instance.new('SelectionBox',ball).Adornee=ball
  472. Instance.new('Sparkles',sword).SparkleColor=bcol'Bright red'.Color
  473.  
  474. Delay(1,function() ---trying to get the sword to shrink before disappearing
  475. ding_snd:Play()
  476. for o=md'-45',md'45',md'45' do
  477. local cl=Part(2,2,3.8*2,'New Yeller',.5)cl:BreakJoints()
  478. local msh2=Mesh(cl,'Sword',2,2,2)
  479. Instance.new('Sparkles',cl).SparkleColor=bcol'Bright red'.Color
  480.  
  481. cl.CFrame=l(sword,0,0,0,math.pi,o)*cfn(0,0,4)
  482. cl.Touched:connect(onTouch)
  483. Add.BV(cl,cl.CFrame.lookVector*100)
  484. Debris:AddItem(cl,1)
  485. Delay(.25,function()spread(cl)coroutine.wrap(fade)(cl,msh2)end)
  486. end
  487. for i=0,1,.1 do
  488. msh2.Scale=orig-Vector3.new(i*orig.x,i*orig.y,i*orig.z)
  489. sword.Transparency=.5+(i/2)
  490. wait()
  491. end
  492. sword:Destroy()
  493. end)
  494. end
  495. tw(rw,rwC0'eq')
  496. end
  497.  
  498. sphere_boom=function()holding=true
  499. tw(rw,cfn()*ang(md'-110',md'20',md'-70'))
  500. while holding do
  501. local wall=Part(20,20,10,'New Yeller',.5)wall.Anchored=true
  502. wall.CFrame=l(torso,0,0,-10)
  503.  
  504. orig=wall.CFrame
  505. tc(wall,l(orig,0,0,-20),.1,'')
  506. for i=0,1,.1 do
  507. for _,v in pairs(Workspace:children())do
  508. local hum=findHum(v)
  509. if hum then
  510. if (wall.Position-hum.Torso.Position).magnitude<20 then
  511. hum.Sit=true hum.Torso.Velocity=cfn(orig.p,l(orig,0,5,-10).p).lookVector*50
  512. end
  513. end
  514. end
  515. wait()
  516. end
  517.  
  518. for i=.5,1,.05 do wall.Transparency=i wait()end wall:Destroy()
  519. end
  520. tw(rw,rwC0'eq')
  521. end
  522.  
  523. RS=game:service'RunService'
  524. float_bp=nil
  525. float_bg=nil
  526. last_t=0
  527.  
  528. function cHeight(obj,mag)
  529. local res=false
  530. local ray=Ray.new(obj.Position,Vector3.FromNormalId(Enum.NormalId.Bottom)*mag)
  531. local obj,pos=Workspace:FindPartOnRay(ray,char)
  532. if obj and pos then
  533. res=true
  534. end
  535. return res
  536. end
  537.  
  538. music_snd=Add.Sound('rbxassetid://161099337',1)
  539. bpm=150*1.5
  540. twtoT = function(Weld, Stop) --- TweenWeld function
  541. local ntab={}
  542. local Start = Weld.C1
  543. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  544. local Stop = Stop
  545. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  546.  
  547. for i = 0, 1, 1/3 do
  548. C1 = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i),
  549. (Start.p.Y * (1 - i)) + (Stop.p.Y * i),
  550. (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  551. (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i),
  552. (Z1 * (1 - i)) + (Z2 * i) )
  553. table.insert(ntab,C1)
  554. wait()
  555. end
  556. table.insert(ntab,Stop)
  557. return ntab
  558. end
  559.  
  560. wave_tab={
  561. cfn()*ang(0,0,md'-45');
  562. cfn();
  563. cfn()*ang(md'-75',0,md'-75');
  564. cfn();
  565. }
  566. wave_tab2={
  567. cfn()*ang(0,0,md'45');
  568. cfn();
  569. cfn()*ang(md'-75',0,md'75');
  570. cfn();
  571. }
  572.  
  573. function music()Lock'L'
  574. tw(rw,cfn())
  575. hw.C0=hwC1'torso'hw.Part0=torso
  576. music_snd:Play()
  577. local elapsed_time=0
  578. local prev_tick=tick()
  579. local Beat=RS.Heartbeat
  580. local metronome=0
  581. local frame=0
  582. holding=true
  583.  
  584. while holding do
  585. Beat:wait()
  586. local d_tick=tick()-prev_tick
  587. elapsed_time=elapsed_time+d_tick
  588. if elapsed_time > 1/(bpm/60)then
  589. for i,v in pairs(Workspace:children())do
  590. local hum=findHum(v)
  591.  
  592. if hum then
  593. local mag=(torso.Position-hum.Torso.Position).magnitude
  594. if mag > 10 and mag < 60 then
  595. local lve=cfn(hum.Torso.Position,torso.Position).lookVector
  596. hum.Torso.Velocity=lve*20 hum.Sit=true
  597. end
  598. end
  599. end
  600. local metronome=metronome+1
  601. frame=frame+(not inverse and 1 or -1)
  602.  
  603. frame=frame>=#wave_tab and 1 or frame
  604.  
  605. local sfp=Part(1,1,1,'Cyan')
  606. local msh=Mesh(sfp,1)
  607. Weld(sfp,torso,0,-2.5,0)
  608. elapsed_time=elapsed_time+d_tick
  609. Spawn(function()
  610. for i=0,1,.1 do
  611. msh.Scale=Vector3.new(1,1,1)+Vector3.new(i*10,0,i*10)
  612. sfp.Transparency=i
  613. wait()
  614. end
  615. sfp:Destroy()
  616. end)
  617. tw(rw,wave_tab[frame],1/(bpm/60),'')
  618. tw(lw,wave_tab2[frame],1/(bpm/60),'')
  619. elapsed_time=elapsed_time-1/(bpm/60)
  620. end
  621. prev_tick=tick()
  622. end
  623. music_snd:Stop()
  624. hw.Part0=rarm
  625. hw.C0=hwC1'arm'
  626. tw(lw,cfn(),.1,'')tw(rw,rwC0'eq')Lock'L'
  627. end
  628. slash_snd=Add.Sound('rbxassetid://143858925',2)
  629. function slash()
  630. tw(rw,cfn(0,1.4,.4)*ang(md'-120',0,md'-90'),.1,'')
  631. tw(hw,cfn(0,.5,0)*ang(md'25'))
  632. tw(rw,cfn(0,.4,-.4)*ang(md'45',0,md'-110'),.3)
  633. slash_snd:Play()
  634. tw(hw,cfn(),.3)
  635. tw(rw,rwC0'eq')
  636. -- tw(hw,cfn()*ang(0,0,math.pi/2))
  637. end
  638.  
  639.  
  640. copter_snd=Add.Sound('rbxassetid://177784375',0)
  641. copter_snd.Sound.Looped=true
  642.  
  643. float = function(mouse)
  644. local t=RS.Stepped:wait()
  645. if ((t-last_t)<.5 and cHeight(torso,10))or(not cHeight(torso,30)) and not float_bp then
  646. copter_snd:Play()
  647. Spawn(function()for i=0,1,.1 do copter_snd:Pitch(i)wait()end end)
  648. float_bp=Add.BP(torso,torso.Position)
  649. float_bg=Add.BG(torso)
  650. float_bg.cframe=cfn(torso.Position,Vector3.new(mouse.hit.p.x,l(torso).p.y,mouse.hit.p.z))
  651. local sp=Part(1,1,1,nil,1)Instance.new('Sparkles',sp).SparkleColor=bcol'Magenta'.Color
  652. sp.Anchored=true
  653. tw(rw,cfn()*ang(md'180'),.3)
  654. for i=0,1,.3 do
  655. hw.C0=hwC1'arm'*cfn(0,0,2*i)*ang(0,math.pi/2*i)
  656. wait()
  657. end
  658. hw.C0=hwC1'arm'*cfn(0,0,2)*ang(0,math.pi/2)
  659. pipe=Part(.1,2,.1)Mesh(pipe,1)Weld(pipe,rarm,0,-gZ'rarm,y'/2-gZ'pipe,y'/2,0)
  660. Spawn(function()
  661. while float_bp do
  662. for i=0,1,.1 do
  663. if not float_bp then break end
  664. float_bp.position=float_bp.position+Vector3.new(0,.05,0)
  665. wait()
  666. end
  667. for i=0,1,.1 do
  668. if not float_bp then break end
  669. float_bp.position=float_bp.position-Vector3.new(0,.05,0)
  670. wait()
  671. end
  672. wait()
  673. end
  674. end)
  675.  
  676. Spawn(function()
  677. while float_bp do
  678. for i=0,m.tau,m.tau/40 do
  679. if not float_bp then break end
  680. sp.CFrame=l(torso,math.cos(i)*2,-2,math.sin(i)*2)
  681. hw.C1= cfn()*ang(i*3,0,0)
  682. wait()
  683. end
  684. wait()
  685. end
  686. sp:Destroy()
  687. end)
  688. elseif float_bp then
  689. float_bp:Destroy()float_bp=nil
  690. float_bg:Destroy()float_bg=nil
  691. pipe:Destroy()
  692. tw(rw,rwC0'eq',.3,'')tw(hw,cfn(),.3,'')
  693.  
  694. for i=1,0,-.3 do
  695. hw.C0=hwC1'arm'*cfn(0,0,2*i)*ang(0,math.pi/2*i)
  696. wait()
  697. end
  698. hw.C0=hwC1'arm'
  699. for i=1,0,-.1 do copter_snd:Pitch(i)wait()end copter_snd:Stop()
  700.  
  701. end
  702. last_t=t
  703. end
  704. speed=5
  705. fly=function(mouse)
  706. copter_snd:Volume(100)
  707. while m_down do
  708. float_bp.position=(float_bp.position+(torso.Position-mouse.hit.p).unit*-speed)
  709. float_bg.cframe=cfn(torso.Position,mouse.hit.p)
  710. wait()
  711. end
  712. copter_snd:Volume(10)
  713. float_bg.cframe=cfn(torso.Position,Vector3.new(mouse.hit.p.x,l(torso).p.y,mouse.hit.p.z))
  714. end
  715. exp_snd=Add.Sound('rbxassetid://165970126',1)
  716.  
  717.  
  718. onClick=function(mouse)
  719. if float_bp then
  720. fly(mouse)
  721. else
  722. slash()
  723. end
  724. end
  725.  
  726. klist={ -- I bind attacks to keys using a table
  727. f=sword_wave;
  728. qq=sphere_boom;
  729. [string.char(32)] = float; --Spacebar
  730. eq=music;
  731. }
  732.  
  733. function onKey(key)
  734. if Keys[key]then Keys[key]=nil
  735. else Keys[key]=1
  736. end
  737. end
  738. if not Workspace:FindFirstChild'TheGamer101' then
  739. hop.Selected:connect(function(mouse)
  740. Equip()
  741. mouse.Button1Down:connect(function()m_down=true if attacking then return end attacking=true onClick(mouse) attacking=false end)
  742. mouse.KeyUp:connect(function(key)onKey(key)for i,v in pairs(klist) do if key == i:sub(1,1) and i:sub(2,2) == 'q' then holding = false end end end)
  743. mouse.KeyDown:connect(function(key)onKey(key)
  744. if attacking then return end
  745. for i,v in pairs(klist) do
  746. if key == i:sub(1,1) then attacking = true v(mouse) attacking = false
  747. end
  748. end
  749. end)
  750. mouse.Button1Up:connect(function()m_down=false end)
  751. end)
  752.  
  753. hop.Deselected:connect(Unequip)
  754. else
  755. -- hw.Part0=rarm hw.C0=hwC1'arm'
  756. Equip()b_slash()Unequip()
  757. end
  758.  
  759. for i,v in pairs(torso:children()) do if v:IsA'BodyGyro' or v:IsA'BodyPosition' or v:IsA'BodyVelocity' then v:Destroy() end end
  760.  
  761. while wait() do
  762. for i,v in pairs(spinning_parts)do
  763. v.C0=v.C0*ang(0,md'2',0)
  764. end
  765. end
Add Comment
Please, Sign In to add comment