Advertisement
Thefrozen106

Pole arm

Jul 20th, 2017
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.85 KB | None | 0 0
  1. --Change mi name
  2.  
  3. owner,name = 'attallamulya','Polearm'
  4. PLAYERS = game:GetService('Players')
  5. ply = PLAYERS[owner]
  6. char = ply.Character
  7. terrain = Workspace.Terrain
  8. pcall(function() char:FindFirstChild("legetdg"):Remove() end)
  9. m = Instance.new("Model",char) m.Name = "legetdg"
  10. if script.Parent.className ~= 'HopperBin' then
  11. hop = Instance.new("HopperBin",PLAYERS[owner].Backpack)
  12. hop.Name = name
  13. script.Parent = hop
  14. script.Name = "Function"
  15. end
  16. owner2 = owner
  17. hop = script.Parent
  18.  
  19. debris = game:GetService("Debris")
  20.  
  21. cfn,ang,v3n,ud2n,V2 = CFrame.new,CFrame.Angles,Vector3.new,UDim2.new,Vector2.new
  22. floatforce = 196.25
  23.  
  24. torso,head = char.Torso,char.Head
  25. attacking = false
  26. track = false
  27.  
  28. rs = torso["Right Shoulder"]
  29. ls = torso["Left Shoulder"]
  30. rh = torso["Right Hip"]
  31. lh = torso["Right Hip"]
  32. neck = torso["Neck"]
  33. rw,lw = nil,nil
  34. rhw,lhw = nil,nil
  35. local orgc1 = rs.C1
  36.  
  37. rarm = char["Right Arm"]
  38. larm = char["Left Arm"]
  39. rleg = char["Right Leg"]
  40. lleg = char["Left Leg"]
  41.  
  42. normposr = cfn(1.5,.5,0)
  43. normposl = cfn(-1.5,.5,0)
  44. normposl2 = cfn(.5,-1.5,0)
  45. normposr2 = cfn(-.5,-1.5,0)
  46. normposn = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0)
  47.  
  48. holdpos = normposr*ang(math.pi/2,0,0)
  49. holdpos2 = normposl*ang(math.pi/2,0,0)
  50.  
  51.  
  52. T = {["P"] = function(x,y,z,color,transparency,cancollide,anchored,parent,typee)
  53. if typee == 'wedge' then
  54. c = Instance.new("WedgePart",m)
  55. elseif typee == 'seat' then
  56. c = Instance.new("Seat",m)
  57. elseif typee == 'vseat' then
  58. c = Instance.new("VehicleSeat",m)
  59. else
  60. c = Instance.new("Part",m)
  61. end
  62. c.TopSurface,c.BottomSurface = 0,0
  63. c.Locked = true
  64. c.formFactor = "Custom"
  65. c.Size = Vector3.new(x,y,z)
  66. if color ~= "random" then
  67. c.BrickColor = BrickColor.new(color)
  68. else c.BrickColor = BrickColor:random()
  69. end
  70. c.Transparency = transparency
  71. c.CanCollide = cancollide
  72. if anchored ~= nil then c.Anchored = anchored end
  73. if parent ~= nil then c.Parent = parent end
  74. return c
  75. end
  76. ,
  77. ["C"] = function(func) coroutine.resume(coroutine.create(func)) end
  78. ,
  79. ["W"] = function(part0,part1,x,y,z,rx,ry,rz,parent)
  80. w = Instance.new("Motor",m)
  81. if parent ~= nil then w.Parent = parent end
  82. w.Part0,w.Part1 = part0,part1
  83. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(rx,ry,rz)
  84. return w
  85. end
  86. ,
  87. ["BG"] = function(parent)
  88. local c = Instance.new("BodyGyro",parent)
  89. c.P = 20e+003
  90. c.cframe = parent.CFrame
  91. c.maxTorque = Vector3.new(c.P,c.P,c.P)
  92. return c
  93. end
  94. ,
  95. ["BP"] = function(parent,position)
  96. local bp = Instance.new("BodyPosition",parent)
  97. bp.maxForce = Vector3.new()*math.huge
  98. bp.position = position
  99. return bp
  100. end
  101. ,
  102. ["F"] = function(parent,size,heat,color,secondcolor,enabled)
  103. f = Instance.new("Fire",parent)
  104. f.Size = size
  105. f.Heat = heat
  106. if enabled ~= nil then f.Enabled = enabled end
  107. if color ~= nil then f.Color = BrickColor.new(color).Color end
  108. if secondcolor ~= nil then f.SecondaryColor = BrickColor.new(secondcolor).Color end
  109. return f
  110. end
  111. ,
  112.  
  113. ["FM"] = function(parent,meshid,x,y,z,meshtexture)
  114. if meshid == "cylinder" then
  115. mesh = Instance.new("CylinderMesh",parent)
  116. mesh.Scale = Vector3.new(x,y,z)
  117. return mesh
  118. elseif meshid == 'block' then
  119. mesh = Instance.new("BlockMesh",parent)
  120. mesh.Scale = Vector3.new(x,y,z)
  121. return mesh
  122. end
  123. mesh = Instance.new("SpecialMesh",parent)
  124.  
  125. if meshid == 'wedge' then
  126. mesh.MeshType = 'Wedge'
  127. elseif meshid == 'sphere' then
  128. mesh.MeshType = 3
  129. elseif type(meshid) == "number" then
  130. mesh.MeshId = "rbxassetid://"..meshid
  131. else
  132. mesh.MeshId = "rbxassetid://"..meshids[meshid]
  133. end
  134. mesh.Scale = Vector3.new(x,y,z)
  135. if meshtexture then
  136. if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else
  137. mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end
  138. end
  139. return mesh
  140. end,
  141.  
  142. ["Dec"] = function(parent,face,id,transparency)
  143. c = Instance.new("Decal",parent)
  144. c.Face = face
  145. c.Texture = id
  146. if transparency then c.Transparency = transparency end
  147. return c
  148. end,
  149. ["S"] = function(id,pitch,volume,parent)
  150. cur = nil
  151. found = false
  152. if type(id) == 'string' then
  153. for i,v in pairs(char.Head:children()) do
  154. if v:IsA("Sound") and v.Name == id and not found then
  155. cur = v
  156. if parent then cur = v:Clone() cur.Parent = parent end
  157. cur.Pitch = pitch
  158. if volume then cur.Volume = volume end
  159. cur:Play()
  160. found = true
  161. return cur
  162. end
  163. end
  164. elseif type(id) == 'number' then
  165. local a = char.Head:FindFirstChild('exteo')
  166. a.SoundId = 'rbxassetid://'..id
  167. a.Pitch = pitch
  168. if volume then a.Volume = volume end
  169. a:Play()
  170. return a
  171. end
  172. end
  173. }
  174. ----GUI SHORTENINGS-----
  175. G = {
  176. ["F"] = function(parent,size,position)
  177. c = Instance.new("Frame",parent)
  178. c.Size = UDim2.new(size.x,0,size.y,0)
  179. c.Style = 2
  180. c.Position = UDim2.new(position.x,0,position.y,0)
  181. return c
  182. end,
  183. ["B"] = function(parent,size,position,text,...)
  184. c = Instance.new("TextButton",parent)
  185. c.Size = UDim2.new(size.x,0,size.y,0)
  186. c.Position = UDim2.new(position.x,0,position.y,0)
  187. c.AutoButtonColor = true
  188. c.Text = text
  189. return c
  190. end,
  191. ["L"] = function(parent,size,position,text)
  192. c = Instance.new("TextLabel",parent)
  193. c.Size = UDim2.new(size.x,0,size.y,0)
  194. c.Position = UDim2.new(position.x,0,position.y,0)
  195. if text then c.Text = text end
  196. return c
  197. end
  198. }
  199. ----GUI SHORTENINGS-----
  200. ------MESHIDS---
  201. meshids = {["penguin"] = 15853464, ["ring"] = 3270017,
  202. ["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["crossbow"] = 15886761,
  203. ["cloud"] = 1095708,["mjolnir"] = 1279013,["diamond"] = 9756362, ["hand"] = 37241605,
  204. ["fist"] = 65322375,["skull"] = 36869983,["totem"] = 35624068,["spikeb"] = 9982590,["dragon"] = 58430372,["fish"] = 31221717, ["coffee"] = 15929962,["spiral"] = 1051557,
  205. ["ramen"] = 19380188,["lightning"] = 72583597,["bullet"]=2697549}---some meshids
  206. textureids = {["cone"] = 1082804,["rainbow"] = 28488599,["fish"] = 31221733, ["coffee"] = 24181455,["monster"] = 33366441,["ramen"] = 19380153}
  207. soundids = {["bell"] = 20005706,["flintlock"] = 13510352,["falcon"] = 1387390,['sensa'] = 4700455,
  208. ['midas'] = 17385513,['spark'] = 10756118,['boom'] = 10730819,['plank'] = 10548112
  209. }
  210. for i,v in pairs(soundids) do
  211. sound = Instance.new("Sound")
  212. sound.SoundId = "http://www.roblox.com/asset/?id="..v
  213. sound.Name = i
  214. sound.Parent = char.Head
  215. end
  216.  
  217. function l(a,x,y,z,b)
  218. if b == nil then
  219. return a.CFrame*cfn(x,y,z)
  220. else
  221. return a*cfn(x,y,z)
  222. end
  223. end
  224.  
  225.  
  226. lock = {["R"] =
  227. function(a)
  228. if a == 1 then
  229. rabrick = T.P(1,1,1,"White",1,false,false)
  230. rw = T.W(rabrick,torso,1.5,.5,0,0,0,0)
  231. T.W(rarm,rabrick,0,-.5,0,0,0,0)
  232. elseif a == 2 then
  233. rlbrick = T.P(1,1,1,"White",1,false,false)
  234. rhw = T.W(rlbrick,torso,-.5,-1.5,0,0,0,0)
  235. T.W(rleg,rlbrick,0,-.5,0,0,0,0)
  236. elseif a == 0 then
  237. rs.Parent = torso
  238. rw.Parent = nil
  239. rabrick:Destroy() rabrick = nil
  240. elseif a == -1 then
  241. rhw.Parent = nil
  242. rh.Parent = torso
  243. rlbrick:Destroy() rlbrick = nil
  244. end
  245. end
  246. , ["L"] = function(a)
  247. if a == 1 then
  248. labrick = T.P(1,1,1,"White",1,false,false)
  249. lw = T.W(labrick,torso,-1.5,.5,0,0,0,0)
  250. T.W(larm,labrick,0,-.5,0,0,0,0)
  251. elseif a == 2 then
  252. llbrick = T.P(1,1,1,"White",1,false,false)
  253. lhw = T.W(llbrick,torso,.5,-1.5,0,0,0,0)
  254. T.W(lleg,llbrick,0,-.5,0,0,0,0)
  255. elseif a == 0 then
  256. ls.Parent = torso
  257. lw.Parent = nil
  258. labrick:Destroy() labrick = nil
  259. elseif a == -1 then
  260. lhw.Parent = nil
  261. lh.Parent = torso
  262. llbrick:Destroy() llbrick = nil
  263. end
  264. end
  265. }
  266.  
  267. M = {["R"] = function(a,b) return math.random(a,b) end,
  268. ["Cos"] = function(a) return math.cos(a) end,
  269. ["Sin"] = function(a) return math.sin(a) end,
  270. ["D"] = function(a) return math.rad(a) end
  271. }
  272.  
  273. hdl = T.P(.25,4,.25,'Brown',0,false,false)
  274. hw = T.W(hdl,rarm,0,-1,0,-math.pi/2,0,0) normh = hw.C1
  275. --[[
  276. p = T.P(.1,2,.3,'Bright green',0,false,false,m,'wedge')
  277. T.W(p,hdl,0,2.95,0,0,math.pi,0)
  278.  
  279. p2 = T.P(.1,1,1,'Bright green',0,false,false,m,'wedge')
  280. T.W(p2,p,0,.5,.65,math.pi/2,0,0)
  281.  
  282. p3 = T.P(.1,1,.5,'Bright green',0,false,false,m,'wedge')
  283. T.W(p3,p2,0,.25,1,math.pi/2,0,0)
  284. ]]--
  285.  
  286. function zeero(mot,a) local oldvelocity = mot.MaxVelocity mot.MaxVelocity = 1.7E+308
  287. if a == nil then mot.DesiredAngle = 0
  288. else mot.DesiredAngle = a
  289. end
  290. while mot.DesiredAngle ~= mot.CurrentAngle do wait() end
  291. mot.MaxVelocity = oldvelocity
  292. end
  293. function ventta(mot)
  294. while mot.DesiredAngle ~= mot.CurrentAngle do wait() end
  295. end
  296.  
  297. function damage(hit,amount,bool)
  298. for i,v in pairs(hit:children()) do
  299. if v:IsA("Humanoid") and v.Parent ~= char then
  300. if bool then
  301. local found = v:FindFirstChild('lol')
  302. if not found then
  303. bo = Instance.new("StringValue",v)
  304. bo.Name = 'lol'
  305. debris:AddItem(bo,bool)
  306. v.Health = v.Health-amount
  307. end
  308. else
  309. v.Health = v.Health-amount
  310. end
  311. end
  312. end
  313. end
  314.  
  315. T.C(function()
  316. while wait() do
  317. wld.DesiredAngle = math.pi
  318. ventta(wld)
  319. zeero(wld,0)
  320. end
  321. end)
  322.  
  323. function spaas(position,radius,number,number2,color)
  324. mode = Instance.new("Model",m)
  325. for i = 1,number2 do
  326. pos = position+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
  327. mag = (position-pos).magnitude
  328.  
  329. col = color or 'Toothpaste'
  330. local laz = T.P(.1,mag,.1,col,0,false,true,mode)
  331.  
  332. T.FM(laz,'cylinder',.3,1,.3)
  333. laz.CFrame = (cfn(position,pos)*cfn(0,0,-mag/2))*ang(math.pi/2,0,0)
  334.  
  335. cframe = (laz.CFrame*cfn(0,-mag/2,0)).p
  336. pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
  337. mag2 = (cframe-pos2).magnitude
  338. local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode)
  339. T.FM(laz2,'cylinder',.3,1,.3)
  340. laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0)
  341.  
  342. previo = laz2
  343. for i = 1,number do
  344. cframe = (previo.CFrame*cfn(0,-mag/2,0)).p
  345. pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
  346. mag2 = (cframe-pos2).magnitude
  347.  
  348. local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode)
  349. T.FM(laz2,'cylinder',.3,1,.3)
  350. laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0)
  351.  
  352. previo = laz2
  353. end
  354.  
  355. end
  356. debris:AddItem(mode,.1)
  357. end
  358.  
  359.  
  360. pp = T.P(.1,.1,.1,'Black',0,false,false)
  361. T.FM(pp,'sphere',1,1,1)
  362.  
  363. wld = T.W(pp,hdl,0,2.5,0,-math.pi/2,0,0)
  364. wld.C0 = cfn()*ang(0,0,0,math.pi/2,0,0)
  365. wld.MaxVelocity = .1
  366.  
  367. for _ = 1,1 do --- WEAPON LOOP
  368. decor = Instance.new("Model",m)
  369. for i = -45,45,90 do
  370. wait()
  371. print('a')
  372. p = T.P(.1,.1,.1,'Black',1,false,false,decor)
  373. T.W(p,pp,0,0,0,0,0,M.D(i))
  374. T.FM(p,'sphere',1,1,1)
  375. r = .3
  376. for i = 0,360,30 do
  377. p2 = T.P(.2,.1,.1,'Deep blue',0,false,false,decor)
  378. T.FM(p2,'block',.9,.25,.45)
  379. T.W(p2,p,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r,math.pi/2,0,-math.pi/2+M.D(i))
  380. p3 = T.P(.1,.1,.1,'Deep blue',0,false,false,decor)
  381. T.FM(p3,'block',.25,.5,.45)
  382. T.W(p3,p2,0,-.05,0,0,0,0)
  383. end
  384. r = .2
  385. for i = 0,360,30 do
  386. p2 = T.P(.2,.1,.1,'Deep blue',0,false,false,decor)
  387. T.FM(p2,'block',.6,.25,.45)
  388. T.W(p2,p,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r,math.pi/2,0,-math.pi/2+M.D(i))
  389. end
  390. r = .35
  391. for i = 0,360,120 do
  392. p2 = T.P(2,.1,.1,'Deep blue',0,false,false,decor)
  393. T.FM(p2,'block',.6,.25,.45)
  394. T.W(p2,p,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r,math.pi/2,0,-math.pi/2+M.D(i))
  395. end
  396. for i = 60,360+60,120 do
  397. p2 = T.P(2,.1,.1,'Deep blue',0,false,false,decor)
  398. T.FM(p2,'block',.62,.25,.45)
  399. T.W(p2,p,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r,math.pi/2,0,-math.pi/2+M.D(i))
  400. end
  401. p4 = T.P(.4,.1,.4,'Lime green',.5,false,false,decor)
  402. T.FM(p4,'cylinder',.9,.45,.9)
  403. T.W(p4,p,0,0,0,0,0,0)
  404. end
  405. end
  406.  
  407. center = _
  408. troll_loop = false
  409.  
  410.  
  411. function star(mouse)
  412. ou = 20
  413. th = 1
  414. wi = 3
  415. centers = {}
  416.  
  417. for _ = 1,1 do ----- CENTER LOOP
  418. pos = cfn(mouse.hit.p)+v3n(0,.1,0) oripos = pos
  419. main = T.P(1,1,1,'White',1,true,true)
  420. main.CFrame = pos
  421. center = main
  422.  
  423. r = .3*ou
  424. for i = 0,360,30 do ---- INNER RING
  425. p2 = T.P(.2,.1,.1,'Deep blue',0,false,true,decor)
  426. T.FM(p2,'block',.9*ou,wi,th)
  427. p2.CFrame = l(main,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r)*ang(math.pi/2,0,-math.pi/2+M.D(i))
  428.  
  429. p3 = T.P(.1,.1,.1,'Deep blue',0,false,true,decor)
  430. T.FM(p3,'block',wi,.5*ou,th)
  431. p3.CFrame = l(p2,0,-.05*ou,0)
  432. end
  433.  
  434. r = .2*ou
  435. for i = 0,360,30 do ---OUTER RING
  436. p2 = T.P(.2,.1,.1,'Deep blue',0,false,true,decor)
  437. T.FM(p2,'block',.6*ou,wi,th)
  438. p2.CFrame = l(main,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r)*ang(math.pi/2,0,-math.pi/2+M.D(i))
  439. end
  440.  
  441. r = .35*ou
  442. for q = 0,60,60 do ----TRIANGLES
  443. for i = q,360+q,120 do
  444. p2 = T.P(2,.1,.1,'Deep blue',0,false,true,decor)
  445. T.FM(p2,'block',.6*ou,wi,th)
  446. p2.CFrame = l(main,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r)*ang(math.pi/2,0,-math.pi/2+M.D(i))
  447. end
  448. end
  449. ----------------
  450. p4 = T.P(.4,.1,.4,'Lime green',.5,false,false,decor) --- EYE
  451. T.FM(p4,'cylinder',.9*(ou*1.15),.45,.9*(ou*1.15))
  452. T.W(p4,main,0,0,0,0,0,0)
  453. -----------------------
  454. end
  455.  
  456. ou = 10
  457. wi = 2
  458.  
  459. for i = 90,360+90,60 do --- MAIN LOOP
  460. pos = cfn(mouse.hit.p)+v3n(M.Cos(M.D(i))*18,.1,M.Sin(M.D(i))*18)
  461. main = T.P(1,1,1,'White',1,true,true)
  462. main.CFrame = pos
  463.  
  464. r = .3*ou
  465. for i = 0,360,30 do ---- INNER RING
  466. p2 = T.P(.2,.1,.1,'Deep blue',0,false,true,decor)
  467. T.FM(p2,'block',.9*ou,wi,th)
  468. p2.CFrame = l(main,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r)*ang(math.pi/2,0,-math.pi/2+M.D(i))
  469.  
  470. p3 = T.P(.1,.1,.1,'Deep blue',0,false,true,decor)
  471. T.FM(p3,'block',wi,.5*ou,th)
  472. p3.CFrame = l(p2,0,-.05*ou,0)
  473. end
  474.  
  475. r = .2*ou
  476. for i = 0,360,30 do ---OUTER RING
  477. p2 = T.P(.2,.1,.1,'Deep blue',0,false,true,decor)
  478. T.FM(p2,'block',.6*ou,wi,th)
  479. p2.CFrame = l(main,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r)*ang(math.pi/2,0,-math.pi/2+M.D(i))
  480. end
  481.  
  482. r = .35*ou
  483. for q = 0,60,60 do ----TRIANGLES
  484. triangle = {}
  485. for i = q+60,360+q,120 do
  486. p2 = T.P(2,.1,.1,'Deep blue',0,false,true,decor)
  487. T.FM(p2,'block',.6*ou,wi,th)
  488. p2.CFrame = l(main,M.Cos(M.D(i))*r,0,M.Sin(M.D(i))*r)*ang(math.pi/2,0,-math.pi/2+M.D(i))
  489. end
  490. end
  491. p4 = T.P(.4,.1,.4,'Lime green',.5,false,true,decor) --- EYE
  492. T.FM(p4,'cylinder',.9*(ou*1.15),.45,.9*(ou*1.15))
  493. p4.CFrame = main.CFrame
  494. table.insert(centers,p4)
  495. end ---- MAIN LOOP END
  496.  
  497. T.C(function() ---- TROLL LOOP
  498. while wait() do
  499. if troll_loop == true then
  500. rand = M.R(0,1)
  501. tex = rand>0 and 'http://www.roblox.com/asset/?id=34697344' or 'http://www.roblox.com/asset/?id=78298767'
  502. local sel = centers[math.random(#centers)]
  503. local pole = T.P(2,1,2,'White',0,true,true)
  504. T.FM(pole,'cylinder',1,1,1)
  505. pole.CFrame = cfn(sel.Position)
  506. local ball = T.P(4,4,4,'Nougat',0,true,true) ball.Shape = 0
  507. local pos = pole.CFrame
  508. for _,v in pairs({'Front','Back','Left','Right'}) do
  509. T.Dec(ball,v,tex)
  510. end
  511. for i = 1,5,5/3 do
  512. pole.Size = v3n(2,i,2)
  513. pole.CFrame = pos+v3n(0,i/2,0)
  514. ball.CFrame = pole.CFrame*cfn(0,i/2+1.95,0)
  515. wait()
  516. end
  517. for i = 5,1,-5/3 do
  518. pole.Size = v3n(2,i,2)
  519. pole.CFrame = pos+v3n(0,i/2,0)
  520. ball.CFrame = pole.CFrame*cfn(0,i/2+1.95,0)
  521. wait()
  522. end
  523. pole:Remove() ball:Remove()
  524. end
  525. end
  526. end)
  527. T.C(function() ---- GIANT TROLL LOOP
  528. while wait(1) do
  529. if troll_loop == true then
  530. pole = T.P(5,1,5,'White',0,true,true)
  531. pole.CFrame = cfn(center.Position)
  532. local ball = T.P(10,10,10,'Nougat',0,true,true) ball.Shape = 0
  533. local pos = pole.CFrame
  534. T.FM(pole,'cylinder',1,1,1)
  535.  
  536. for _,v in pairs({'Front','Back','Left','Right'}) do
  537. T.Dec(ball,v,'http://www.roblox.com/asset/?id=34697344')
  538. end
  539. for i = 1,30 do
  540. pole.Size = v3n(5,i,5)
  541. pole.CFrame = pos+v3n(0,i/2,0)
  542. ball.CFrame = pole.CFrame*cfn(0,i/2+4.95,0)
  543. wait()
  544. end
  545. for i = 30,1,-1 do
  546. pole.Size = v3n(5,i,5)
  547. pole.CFrame = pos+v3n(0,i/2,0)
  548. ball.CFrame = pole.CFrame*cfn(0,i/2+4.95,0)
  549. wait()
  550. end
  551. pole:Remove() ball:Remove()
  552. end
  553.  
  554. end
  555. end)
  556.  
  557. end --- FUNCTION END
  558.  
  559. function spark(mouse)
  560. if cannon then return end
  561. lock.R(1)
  562. for i = 0,1,.1 do
  563. wait()
  564. rw.C1 = normposr*ang(M.D(120*i),0,M.D(20*i))
  565. hw.C1 = normh*ang(0,0,M.D(90*i))
  566. end
  567. holding = true
  568. laz = T.P(.1,.1,.1,'Lime green',.5,false,true)
  569. T.FM(laz,'cylinder',1,1,1)
  570. while holding do
  571. if mouse.Target then
  572. spaas(pp.Position,1,2,1,'New Yeller')
  573. mag = (pp.Position-mouse.hit.p).magnitude
  574. laz.Size = v3n(.1,mag,.1)
  575. laz.CFrame = (cfn(pp.Position,mouse.hit.p)*cfn(0,0,-mag/2))*ang(math.pi/2,0,0)
  576.  
  577. decp = T.P(1,0,1,'White',1,false,true)
  578. pos = mouse.Target.CFrame:pointToObjectSpace(mouse.hit.p)
  579. decp.CFrame = cfn(pos,mouse.hit.p)*ang(-math.pi,0,0)
  580.  
  581. local pos = mouse.hit.p
  582. T.C(function()
  583. rand = M.R(1,3)
  584. local p = T.P(rand,1,rand,'Earth green',0,true,true)
  585. p.CFrame = cfn(pos)
  586. for i = 1,M.R(3,10) do
  587. wait()
  588. p.Size = v3n(p.Size.x,i,p.Size.z)
  589. p.CFrame = cfn(pos)+v3n(0,i/2,0)
  590. spaas(p.Position,10,1,1,'Deep blue')
  591. T.S('spark',1)
  592. end
  593. end)
  594. end
  595. wait()
  596. end
  597. laz:Remove()
  598. for i = 1,0,-.1 do
  599. wait()
  600. rw.C1 = normposr*ang(M.D(120*i),0,M.D(20*i))
  601. hw.C1 = normh*ang(0,0,M.D(90*i))
  602. end
  603. lock.R(0)
  604. end
  605.  
  606. cannon = _
  607. function cannonstaff()
  608. if not cannon then
  609. hw.C1 = normh
  610. cannon = T.P(1,3,1,'White',0,false,false)
  611. msh = T.FM(cannon,81616091,1,1,1,81616111)
  612. T.W(cannon,hdl,0,-1,0,math.pi,0,0)
  613. lock.R(1)
  614. for i = 0,1,.1 do
  615. rw.C1 = normposr*ang(M.D(180*i),0,0)
  616. msh.Scale = v3n(5*i,2.5*i,5*i)
  617. wait()
  618. end
  619. old=rw.C1
  620. for i = 0,1,.1 do
  621. hw.C1 = normh*cfn(0,0,-3*i)*ang(math.pi/2*i,0,0)
  622. rw.C1 = old*ang(M.D(-90*i),0,0)
  623. wait()
  624. end
  625. else
  626. for i = 1,0,-.1 do
  627. hw.C1 = normh*cfn(0,0,-3*i)*ang(math.pi/2*i,0,0)
  628. rw.C1 = normposr*ang(M.D(90*i),0,0)
  629. msh.Scale = v3n(5*i,2.5*i,5*i)
  630. wait()
  631. end
  632. cannon:Remove() cannon = nil
  633. lock.R(0)
  634. end
  635. end
  636.  
  637. plank = false
  638. flying = false
  639.  
  640. plank = nil
  641. function Planko()
  642. if plank then plank:Remove() plank = nil return end
  643. plank = T.P(10,1,10,'White',1,true,true)
  644. plank.CFrame = torso.CFrame*cfn(0,-3.5,0)
  645. plank.Material = 'Wood'
  646. torso.CFrame = torso.CFrame+v3n(0,.2,0)
  647. T.C(function()
  648. while wait() do
  649. plank.Velocity = plank.CFrame.lookVector*30
  650. plank.CFrame = torso.CFrame*cfn(0,-3.5,0)
  651. wait()
  652. end
  653. end)
  654. end
  655.  
  656. function shoot()
  657. local bullet = T.P(1,1,3,'Black',0,true,false)
  658. local box = Instance.new("SelectionBox",bullet)
  659. box.Adornee = bullet
  660. bullet.CFrame = cannon.CFrame*cfn(0,6,0)*ang(math.pi/2,0,0)
  661. T.FM(bullet,'bullet',1,1,1)
  662. T.F(bullet,2,1,'Magenta','Alder')
  663. T.S('flintlock',1,200)
  664. Instance.new("BodyForce",bullet).force = torso.CFrame.lookVector*300+v3n(0,bullet:GetMass()*floatforce,0)
  665. bullet:BreakJoints()
  666. bullet.Touched:connect(function(hit)
  667. if not hit.Parent:IsDescendantOf(char) then
  668. T.S('boom',1,100,bullet)
  669. e = Instance.new("Explosion",Workspace)
  670. e.BlastPressure = 0
  671. e.Position = bullet.Position
  672. e.Hit:connect(function(hit) damage(hit.Parent,30,1) end)
  673. local cf = bullet.CFrame*cfn(0,0,1.5)
  674. bullet:Remove()
  675. local part = T.P(1,1,1,'White',1,true,true)
  676. part.Touched:connect(function(hit) damage(hit.Parent,1) end)
  677. box.Adornee,box.Parent = part,part
  678. for i = 1,30 do
  679. part.Size = v3n(i,i,i)
  680. part.CFrame = cf*ang(M.D(360/30*i),M.D(360/30*i),M.D(360/30*i))
  681. wait()
  682. end
  683. part:Remove()
  684. else
  685. T.S('plank',1,100,bullet)
  686. end
  687. end)
  688. for i = 0,1,.5 do
  689. rw.C1 = holdpos*ang(M.D(30*i),0,0)
  690. wait()
  691. end
  692. for i = 1,0,-.5 do
  693. rw.C1 = holdpos*ang(M.D(30*i),0,0)
  694. wait()
  695. end
  696. end
  697.  
  698. function lightning()
  699. lock.R(1) lock.L(1)
  700.  
  701. for i = 0,1,.1 do
  702. rw.C1 = normposr*ang(M.D(100*i),0,M.D(-30*i))*cfn(0,-.7*i,0)
  703. lw.C1 = normposl*ang(M.D(150*i),0,M.D(15*i))
  704. hw.C1 = normh*ang(0,0,M.D(50*i))
  705. wait()
  706. end
  707. wait(1)
  708. fire = T.F(pp,1,1,'White','Black')
  709. for i = 1,0,-.1 do
  710. rw.C1 = normposr*ang(M.D(100*i),0,M.D(-30*i))*cfn(0,-.7*i,0)
  711. lw.C1 = normposl*ang(M.D(150*i),0,M.D(15*i))
  712. wait()
  713. end
  714. for i = 0,1,.1 do
  715. rw.C1 = normposr*ang(M.D(180*i),0,0)
  716. hw.C1 = normh*cfn(0,0,-2*i)*ang(M.D(-90*i),0,0)
  717. wait()
  718. end
  719. local p = T.P(1,1,1,'White',0,false,true)
  720. pos = torso.CFrame
  721. msh = T.FM(p,'sphere',1,1,1)
  722. fire.Parent = p
  723. for i = 1,30 do
  724. p.CFrame = pos*cfn(0,-3+i,0)
  725. msh.Scale = v3n(i,i,i)
  726. wait()
  727. end
  728. fire:Remove()
  729. msh.MeshId = 'rbxassetid://'..meshids['spikeb']
  730. for i = 10,30 do
  731. msh.Scale = v3n(i,i,i)
  732. p.Transparency = i/30
  733. wait()
  734. end
  735.  
  736. p:Remove()
  737. for i = 1,0,-.1 do
  738. rw.C1 = normposr*ang(M.D(180*i),0,0)
  739. hw.C1 = normh*cfn(0,0,-2*i)*ang(M.D(-90*i),0,0)
  740. wait()
  741. end
  742. lock.R(0) lock.L(0)
  743. end
  744.  
  745. function onButton1Down(a)
  746. if cannon then
  747. shoot(a)
  748. else
  749. star(a)
  750. end
  751. end
  752.  
  753. nlist = {'f','r'}
  754.  
  755. klist = {
  756. {'f',function(a) spark(a) end,''},
  757. {'q',function() cannonstaff() end,''},
  758. {'e',function() Planko() end},
  759. {'r',function() lightning() end},
  760. {'t',function(a) if a.Target then torso.CFrame = cfn(a.hit.p)+v3n(0,2.6,0) end end}
  761. }
  762.  
  763. hop.Deselected:connect(function() lock.R(0) lock.L(0) end)
  764. hop.Selected:connect(function(mouse)
  765. mouse.Button1Up:connect(function() holding = false end)
  766. mouse.KeyUp:connect(function(a) for i,v in pairs(klist) do if a == v[1] and v[3] ~= nil then holding = false end end end)
  767. mouse.KeyDown:connect(function(key)
  768. for i,v in pairs(nlist) do if key == v and cannon then return end end
  769. if attacking then return end
  770. for i,v in pairs(klist) do
  771. if key == v[1] then attacking = true v[2](mouse) attacking = false end
  772. end
  773. end)
  774. mouse.Button1Down:connect(function() if attacking then return end attacking = true onButton1Down(mouse) attacking = false end)
  775. end)
  776. --mediafire
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement