LegendOfAwesomeness2

Alastaff

Jan 12th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.44 KB | None | 0 0
  1. --MADE BY OneLegend (NOT THE SCRIPT) Thanks to TheRedAngel for letting me add. Feel free to take his model too. http://www.roblox.com/TheRedAngels-SB-Gift-NEW-SCRIPTS-item?id=88063410
  2. --LOCAL SCRIPT: JUST RUN!
  3.  
  4. --===============Changes===============--
  5. new= Instance.new;
  6. unew= UDim2.new;
  7. vnew= Vector3.new;
  8. fnew= CFrame.new;
  9. cnew= Color3.new;
  10. bcn= BrickColor.new;
  11. look= CFrame.lookVector;
  12. rot= CFrame.fromEulerAnglesXYZ;
  13. --=====================================--
  14.  
  15. Tool=new('Tool')
  16. Tool.Name='AlaStaff'
  17. Tool.GripPos=vnew(0,.5,0)
  18. Tool.TextureId='http://www.roblox.com/asset/?id=54353092'
  19. ToolHandle=new('Part')
  20. ToolHandle.Material=('Wood')
  21. ToolHandle.BrickColor=bcn('Reddish brown')
  22. ToolHandle.Name='Handle'
  23. ToolHandle.formFactor=3
  24. ToolHandle.Size=vnew(.5,6,.5)
  25. ToolHandle.CanCollide=false
  26. ToolHandle.Parent=Tool
  27. Tool.Parent=game.Players.LocalPlayer.Backpack
  28. script.Parent = Tool
  29.  
  30. --================Tool!================--
  31. tool=script.Parent
  32. staff=tool.Handle
  33. SmokePart=nil
  34. --=====================================--
  35.  
  36. --===============Player!===============--
  37. player=nil
  38. if tool.Parent:IsA('Model')then
  39. player=game.Players[tool.Parent.Name]
  40. elseif tool.Parent:IsA('Backpack')then
  41. player=tool.Parent.Parent
  42. end
  43. --=====================================--
  44.  
  45. --================Math!================--
  46. random= math.random;
  47. pi= math.pi;
  48. --=====================================--
  49.  
  50. --==============Services!==============--
  51. debris= game:service('Debris')
  52. workspace= game:service('Workspace')
  53. lighting= game:service('Lighting')
  54. insert= game:service('InsertService')
  55. --=====================================--
  56.  
  57. --===============Changes===============--
  58. new= Instance.new;
  59. unew= UDim2.new;
  60. vnew= Vector3.new;
  61. fnew= CFrame.new;
  62. cnew= Color3.new;
  63. bcn= BrickColor.new;
  64. look= CFrame.lookVector;
  65. rot= CFrame.fromEulerAnglesXYZ;
  66. soul= 0;
  67. --=====================================--
  68.  
  69. clickActive=false
  70. kayActive=false
  71.  
  72. --===========Base Functions!===========--
  73. x=function(f)coroutine.resume(coroutine.create(f))end
  74.  
  75. sing=function(name,parent)
  76. x(function()
  77. mmo=new('Model')
  78. debris:AddItem(mmo,1)
  79. mmo.Name='StaffFunction'..name
  80. V=new('ObjectValue',mmo)
  81. V.Value=player
  82. V.Name='user'
  83. mmq=new('ObjectValue',mmo)
  84. mmq.Name='parent'
  85. mmq.Value=parent
  86. mmc=mmo:clone()
  87. debris:AddItem(mmc,1)
  88. mmc.Parent=lighting
  89. end)
  90. end
  91.  
  92. ko=function(humanoid)
  93. if humanoid:FindFirstChild('creator',true)then return end
  94. k=new('ObjectValue')
  95. k.Name='creator'
  96. k.Value=player
  97. k.Parent=humanoid
  98. player.Character.Humanoid:TakeDamage(-humanoid.MaxHealth)
  99. soul=soul+1
  100. end
  101.  
  102. s1=function(t)
  103. x(function()
  104. clickActive=false
  105. for i,h in pairs(t.Parent:children())do
  106. if h:IsA('Humanoid')then
  107. h:TakeDamage(.1)
  108. if h.Health<=0 then
  109. ko(h)
  110. print'DIE!'
  111. end
  112. return
  113. end
  114. end
  115. t:BreakJoints()
  116. clickActive=false
  117. end)
  118. end
  119.  
  120. s2=function(t)
  121. x(function()
  122. delay(.1,function()s3(t)end)
  123. if t:FindFirstChild('w-')then return end
  124. q=player.Character.Torso.CFrame.lookVector
  125. wq=new('BodyThrust')
  126. debris:AddItem(wq,.2)
  127. x(function()debris:AddItem(t.Smoke,.02)end)
  128. x(function()
  129. smc=Smoke:clone()
  130. debris:AddItem(smc,3)
  131. smc.Enabled=true
  132. smc.Parent=t
  133. end)
  134. wq.force=vnew(40,40,40)
  135. wq.location=vnew(0,100,1)
  136. wq.Parent=t
  137. qwe = Instance.new('BodyVelocity')
  138. debris:AddItem(qwe,.3)
  139. qwe.Name='w-'
  140. qwe.maxForce=Vector3.new(1e7,1e7,1e7)
  141. qwe.P=125
  142. qwe.velocity=(Vector3.new(q.x,q.y,q.z)*100)+Vector3.new(0,30,0)
  143. qwe.Parent=t
  144. clickActive=false
  145. for i,h in pairs(t.Parent:children())do
  146. if h:IsA('Humanoid')then
  147. h:TakeDamage(10)
  148. if h.Health<=0 then
  149. ko(h)
  150. print'DIE!'
  151. end
  152. return
  153. end
  154. end
  155. t:BreakJoints()
  156. clickActive=false
  157. end)
  158. end
  159.  
  160. s3=function(t)
  161. x(function()
  162. if t.Size.x+t.Size.y+t.Size.z<=20 then
  163. t.Anchored=false
  164. end
  165. if staff:FindFirstChild('ow')or staff:FindFirstChild('wq')then return end
  166. pa=new('Part')
  167. debris:AddItem(pa,3)
  168. pa.Name='ow'
  169. pa.formFactor=0
  170. pa.Size=vnew(1,1,1)
  171. pa.Transparency=1
  172. pa.CanCollide=false
  173. pa.Parent=staff
  174. fire=new('Fire',pa)
  175. fire.Size=3
  176. fire.Heat=14
  177. weld=new('Weld',staff)
  178. weld.Part0=staff
  179. weld.Part1=pa
  180. weld.C0=fnew(0,staff.Size.y/1.3,0)
  181. clickActive=false
  182. for i,h in pairs(t.Parent:children())do
  183. if h:IsA('Humanoid')then
  184. h:TakeDamage(20)
  185. if h.Health<=0 then
  186. ko(h)
  187. end
  188. return
  189. end
  190. end
  191. t:BreakJoints()
  192. clickActive=false
  193. end)
  194. end
  195. --=====================================--
  196. tool.TextureId='http://www.roblox.com/asset/?id=54353092'
  197. tool.Activated:connect(function()
  198. if kayActive==true then return end
  199. clickActive=true
  200. mode=mode+1
  201. if mode==2 then
  202. a=new('StringValue')
  203. debris:AddItem(a,1)
  204. a.Name='toolanim'
  205. a.Value='Slash'
  206. a.Parent=tool
  207. elseif mode==3 then
  208. s3()
  209. end
  210. wait(.3)
  211. mode=1
  212. clickActive=false
  213. end)
  214. tool.Equipped:connect(function(d)
  215. pcall(function()staff.CFrame=player.Character['Right Arm'].CFrame end)
  216. d.KeyUp:connect(function(k)if k=='e'then Round=false end end)
  217. d.KeyDown:connect(function(k)
  218. x(function()
  219. if k=='t'then
  220. if clickActive==true then return end
  221. kayActive=true --Rofl
  222. if d.Target==nil then return end
  223. torso=player.Character.Torso
  224. torso.Velocity=vnew(0,0,0)
  225. torso.RotVelocity=vnew(0,0,0)
  226. torso.CFrame=fnew(d.Hit.p.x,d.Hit.p.y+5,d.Hit.p.z)
  227. torso.Velocity=vnew(0,0,0)
  228. torso.RotVelocity=vnew(0,0,0)
  229. Sp.Enabled=true
  230. wait(.1)
  231. Sp.Enabled=false
  232. kayActive=false
  233. elseif k=='p'then
  234. if Poisoning==true then print'Poisoning Active!' return end
  235. Poisoning=true
  236. Pp=new('Part')
  237. Pp.formFactor=0
  238. Pp.Size=vnew(1,1,1)
  239. Pp.Transparency=.9
  240. Pp.Position=d.Hit.p
  241. Pp.BrickColor=BrickColor.Green()
  242. Pp.CanCollide=false
  243. Pp.Anchored=true
  244. new('SpecialMesh',Pp).MeshType='Sphere'
  245. Pp.Mesh.Scale=vnew(50,50,50)
  246. Pp.Parent=workspace
  247. for lw=1,10 do
  248. nPp=new('Part')
  249. nPp.formFactor=0
  250. nPp.Size=vnew(1,1,1)
  251. nPp.Transparency=.9
  252. nPp.CFrame=Pp.CFrame
  253. nPp.BrickColor=BrickColor.Green()
  254. nPp.CanCollide=false
  255. nPp.Anchored=true
  256. new('SpecialMesh',nPp).MeshType='Sphere'
  257. nPp.Mesh.Scale=vnew(4.5*lw,4.5*lw,4.5*lw)
  258. nPp.Parent=Pp
  259. end
  260. debris:AddItem(Pp,200*.2)
  261. delay(0,function()
  262. for RoundNew=1,200 do
  263. wait(.2)
  264. if Pp==nil then break end
  265. pcall(function()
  266. for yy,X in ipairs(game:service('Players'):GetPlayers())do
  267. if X~=player then
  268. pcall(function()
  269. if (X.Character.Torso.Position-Pp.Position).magnitude<30 then
  270. for z,humaa in pairs(X.Character:children())do
  271. if humaa:IsA('Humanoid')then
  272. pcall(function()
  273. newSound=new('Sound')
  274. newSound.Parent=X.Backpack
  275. end)
  276. humaa:TakeDamage(5)
  277. if humaa.Health<=0 then
  278. ko(humaa)
  279. end
  280. end
  281. end
  282. end
  283. end)
  284. end
  285. end
  286. end)
  287. end
  288. pcall(function()Pp:remove()end)
  289. Poisoning=false
  290. end)
  291. elseif k=='e'then
  292. if clickActive==true or kayActive==true then return end
  293. kayActive=true
  294. Round=true
  295. Sp.Enabled=true
  296. soundnew=new('Sound')
  297. soundnew.SoundId='rbxasset://sounds/collide.wav'
  298. soundnew.Pitch=.5
  299. soundnew.Volume=1
  300. repeat
  301. wait(.05)
  302. pcall(function()
  303. for ah,Vplayer in ipairs(game:service('Players'):GetPlayers())do
  304. pcall(function()
  305. if (Vplayer.Character.Torso.Position-d.Hit.p).magnitude<7 then
  306. for l,o in pairs(Vplayer.Character:children())do
  307. if o:IsA('Humanoid')then ko(o)end
  308. end
  309. end
  310. end)
  311. end
  312. pcall(function()player.Character.Torso.CFrame=fnew(player.Character.Torso.Position,vnew(d.hit.p.x,0,d.hit.p.z))end)
  313. Apart=new('Part')
  314. soundnew:clone().Parent=Apart
  315. debris:AddItem(Apart,.3)
  316. Apart.formFactor=0
  317. Apart.Size=vnew(1,1,1)
  318. Apart.Transparency=.2
  319. Apart.CanCollide=true
  320. --Apart.Anchored=true
  321. rand=math.random(1,6)
  322. new('BlockMesh',Apart).Scale=vnew(rand,rand,rand)
  323. Apart.BrickColor=BrickColor.random()
  324. Apart.CFrame=rot(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))+d.Hit.p+vnew(math.random(-2,2),math.random(-2,2),math.random(-2,2))
  325. Apart.Parent=workspace
  326. pcall(function()Apart.Sound:play()end)
  327. pcall(function()Apart.Sound:play()end)
  328. exp=new('Explosion')
  329. exp.BlastRadius=6
  330. exp.Position=Apart.Position
  331. exp.Parent=Apart
  332. end)
  333. until Round==false
  334. pcall(function()
  335. soundnew:remove()
  336. Sp.Enabled=false
  337. end)
  338.  
  339. kayActive=false
  340. elseif k=='n'then
  341. if clickActive==true then return end
  342. kayActive=true
  343. Smoke.RiseVelocity=20
  344. x(function()
  345. if Smoke.Enabled==true then return end
  346. for i,v in pairs(SmokePart:children())do
  347. x(function()v.Enabled=true end)
  348. end
  349. for b=1,10 do
  350. wait()
  351. for i,v in pairs(tool:children())do
  352. if v==staff then
  353. v.BrickColor=bcn(1003)
  354. v.Material=('Slate')
  355. wait()
  356. v.Material=('Wood')
  357. v.BrickColor=bcn('Reddish brown')
  358. end
  359. if v~=staff and v~=SmokePart and v~=script then
  360. v.Material=('Plastic')
  361. v.Transparency=b/10
  362. if b==10 then
  363. v:remove()
  364. end
  365. end
  366. end
  367. end
  368. for i,v in pairs(SmokePart:children())do
  369. x(function()v.Enabled=false end)
  370. end
  371. Smoke.RiseVelocity=5
  372. kayActive=false
  373. end)
  374. elseif k=='q'then
  375. if clickActive==true then return end
  376. kayActive=true
  377. x(function()
  378. if Sp.Enabled==true then return end
  379. Sp.Enabled=true
  380. Model=new('Model',player.Character)
  381. debris:AddItem(Model,30)
  382. Model.Name='Snare'..random(-999999,999999)
  383. partnew=new('Part')
  384. partnew.Anchored=true
  385. partnew.Shape=0
  386. partnew.Size=vnew(4,4,4)
  387. partnew.Material=('Slate')
  388. partnew.BrickColor=bcn('Bright red')
  389. partnew.BottomSurface=0
  390. partnew.TopSurface=0
  391. partnew.Name='Main'
  392. partnew.CFrame=fnew(d.Hit.p.x,d.Hit.p.y,d.Hit.p.z)
  393. partnew.Parent=Model
  394. for ee=1,6 do
  395. partlist={}
  396. for aa=1,14 do
  397. wait()
  398. p=new('Part')
  399. partlist[aa]=p
  400. p.formFactor=3
  401. p.CanCollide=false
  402. p.Size=vnew(2,2,2)
  403. p.BottomSurface=0
  404. p.TopSurface=0
  405. p.Material=('Slate')
  406. if aa~=1 then
  407. p.BrickColor=bcn(1003)
  408. p.Size=Vector3.new(2,2,2/(aa/10))
  409. end
  410. p.CFrame=partnew.CFrame
  411. p.Parent=Model
  412. if aa==1 then
  413. w=new('Weld',partnew)
  414. else
  415. wq=aa-1
  416. w=new('Weld',partlist[wq])
  417. end
  418. w.Part0=w.Parent
  419. w.Part1=p
  420. w.C0=rot(0,0,.25/-aa)+vnew(p.Size.x/2,0,0)
  421. if aa==2 then
  422. w.C0=rot(0,ee,.2)+vnew(0,.2,0)
  423. end
  424. end
  425. end
  426. for i,v in pairs(Model:children())do
  427. if v:IsA('BasePart')then
  428. v.Anchored=true
  429. v:BreakJoints()
  430. end
  431. end
  432. sing('1',partnew)
  433. Sp.Enabled=false
  434. kayActive=false
  435. end)
  436. end
  437. end)
  438. end)
  439.  
  440. x(function()mainarm=player.Character['Right Arm']
  441. weld=new('Weld',mainarm)
  442. weld.Part0=weld.Parent
  443. weld.Part1=staff
  444. weld.C0=rot(-pi/2,0,0)+vnew(0,-1,.55)
  445. end)
  446. tool.TextureId='http://www.roblox.com/asset/?id=54353092'
  447. mode=1
  448. if z~=nil then return end
  449. z='asd'
  450. for i,v in pairs(tool:children())do
  451. if v~=staff and v~=script then
  452. v:remove()
  453. end
  454. end
  455. x(function()
  456. for cc=1,6 do
  457. for i=1,13 do
  458. wait''
  459. if tool.Parent~=player.Character then
  460. break
  461. end
  462. x(function()
  463. p=new('Part')
  464. p.Name=i
  465. p.formFactor=3
  466. p.CanCollide=false
  467. p.Size=vnew(.6,.6,.6)
  468. p.Material=('Slate')
  469. if i~=1 then
  470. p.Size=vnew(.52+i/200,.52-i/40,.52-i/40)
  471. p.BrickColor=bcn(1003)
  472. end
  473. p.CFrame=staff.CFrame
  474. p.Parent=tool
  475. if i==1 then
  476. w=new('Weld',staff)
  477. else
  478. qn=tool[i-1]
  479. w=new('Weld',tool[i-1])
  480. qn.Name='?'
  481. end
  482. w.Part0=w.Parent
  483. w.Part1=p
  484. if i==1 then
  485. w.C0=rot(0,-pi/2*cc/1.5,.2)+vnew(0,staff.Size.y/2,0)
  486. else
  487. w.C0=rot(0,0,.2)+vnew(p.Size.x/2,0,0)
  488. end
  489. end)
  490. end
  491. end
  492. end)
  493. p=new('Part')
  494. p.Shape=0
  495. p.Name='a'
  496. p.Material=('Slate')
  497. p.Size=vnew(1,1,1)
  498. p.CanCollide=false
  499. p.Parent=tool
  500. w=new('Weld',staff)
  501. w.Part0=staff
  502. w.Part1=p
  503. w.C0=fnew(0,staff.Size.y/2,0)
  504.  
  505. p=new('Part')
  506. p.Shape=0
  507. p.Name='Smoke'
  508. p.Material=('Slate')
  509. p.BottomSurface=0
  510. p.TopSurface=0
  511. p.Size=vnew(1,1,1)
  512. p.BrickColor=bcn(1003)
  513. p.CanCollide=false
  514. p.Parent=tool
  515. Smoke=new('Smoke',p)
  516. Smoke.Size=.01
  517. Smoke.Enabled=false
  518. Smoke.Color=cnew(0,0,0)
  519. Smoke.Opacity=1
  520. Smoke.RiseVelocity=5
  521. Sp=new('Sparkles')
  522. Sp.Enabled=false
  523. Sp.Parent=p
  524. Sp.Color=cnew(1,0,0)
  525. w=new('Weld',staff)
  526. w.Part0=staff
  527. w.Part1=p
  528. w.C0=fnew(0,staff.Size.y/1.3,0)
  529. SmokePart=p
  530. hagal={}
  531. for y=1,4 do
  532. for i=1,20 do
  533. if tool.Parent~=player.Character then
  534. break
  535. end
  536. p=new('Part')
  537. hagal[i]=p
  538. p.formFactor=3
  539. p.Name='q'
  540. p.BrickColor=bcn(1003)
  541. p.Size=vnew(.5,.4,.5)
  542. p.Material=('Slate')
  543. p.CanCollide=false
  544. p.Parent=tool
  545. if i==1 then
  546. w=new('Weld',staff)
  547. else
  548. w=new('Weld',hagal[i-1])
  549. end
  550. w.Part0=w.Parent
  551. w.Part1=p
  552. if i==1 then
  553. w.C0=rot(0,pi/2*y,0)+vnew(0,(staff.Size.y/2)-i*p.Size.y+.2,0)
  554. elseif i<=10 then
  555. w.C0=rot(0,pi/2/i,0)+vnew(.05,-p.Size.y/2,0)
  556. elseif i>10 then
  557. w.C0=rot(.1,pi/2/i*6,0)+vnew(.03,-p.Size.y,0)
  558. end
  559. wait''
  560. end
  561. end
  562. for i,v in pairs(tool:children())do
  563. if v.Name=='Smoke'then
  564. v.Touched:connect(function(a)
  565. x(function()
  566. if a.Parent~=player.Character and a.Parent~=tool then
  567. if mode==1 then
  568. s1(a)
  569. elseif mode==2 then
  570. s2(a)
  571. elseif mode==3 then
  572. s3(a)
  573. end
  574. end
  575. end)
  576. end)
  577. end
  578. end
  579. end)
  580. tool.Unequipped:connect(function()
  581. if tool.Parent:IsA('Backpack')then
  582. for i,v in pairs(tool:children())do
  583. if v~=staff and v~=script then
  584. v:remove()
  585. end
  586. end
  587. end
  588. z=nil
  589. end)
  590. x(function()
  591. player.Character.Humanoid.Died:connect(function()if tool.Parent~=player.Character then tool:remove() return end
  592. if fakestaff~=nil then return end
  593. fakestaff=new('Model',workspace)
  594. debris:AddItem(fakestaff,10)
  595. for i,v in pairs(tool:children())do
  596. if v~=script then
  597. v.Parent=fakestaff
  598. v.Anchored=true
  599. x(function()v.Smoke.Enabled=true end)
  600. x(function()v.Sparkles.Enabled=true end)
  601. end
  602. end
  603. sing('2',fakestaff.Smoke)
  604. fakestaff.Handle:remove()
  605. fakestaff:BreakJoints()
  606. tool:remove()
  607. end)
  608. end)
Add Comment
Please, Sign In to add comment