Advertisement
kaneewutt

Rare!

Nov 25th, 2014
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.87 KB | None | 0 0
  1. --[[
  2. TODO::
  3. --ethereal blade in left hand
  4. --dagger in right han
  5. dagon on top of power
  6. anims
  7. rockets
  8. rocketpropulsion
  9.  
  10. legacy keys
  11. e for laser
  12. t for rockets
  13. etc.
  14.  
  15. smoke pipe
  16. smoke
  17.  
  18. mana
  19. charge mana
  20. lightning between handheld buttons
  21.  
  22. ::
  23. Reese123 was here
  24. ]]
  25.  
  26. --- shortcuts
  27. v3 = Vector3.new
  28. cn = CFrame.new
  29. ca2 = CFrame.Angles
  30. mceil = math.ceil mc = mceil
  31. mran = math.random rn=mran
  32. mrad = math.rad rd=mrad
  33. mdeg = math.deg dg=mdeg
  34. mabs = math.abs abs=mabs
  35. ud = UDim2.new
  36. ca = function(x,y,z) return ca2(mrad(x),mrad(y),mrad(z)) end
  37. mran2 = function(a,b) return mran(a*1000,b*1000)/1000 end
  38. bn = BrickColor.new bc=bn
  39. c3 = Color3.new
  40. deb = game:GetService("Debris")
  41. -----
  42. Player = game:service("Players").LocalPlayer
  43. Char = Player.Character
  44. Torso = Char.Torso
  45. Head = Char.Head
  46. Humanoid = Char.Humanoid
  47. RootPart = Char.HumanoidRootPart
  48. Root = RootPart.RootJoint
  49. Neck = Torso.Neck
  50. Mouse = Player:GetMouse()
  51. LA = Char["Left Arm"]
  52. RA = Char["Right Arm"]
  53. LL = Char["Left Leg"]
  54. RL = Char["Right Leg"]
  55. LAM = Torso["Left Shoulder"]
  56. RAM = Torso["Right Shoulder"]
  57. LLM = Torso["Left Hip"]
  58. RLM = Torso["Right Hip"]
  59.  
  60. Neck.C0=cn(0,1.5,0)
  61. Neck.C1=cn(0,0,0)
  62. Root.C0=cn(0,0,0)
  63. Root.C1=cn(0,0,0)
  64.  
  65. name="Tinker"
  66.  
  67. pcall(function() Char["Pack"]:Destroy() end)
  68. pcall(function() Char.Block:Destroy() end)
  69. pcall(function() Torso.BodyGyro:Destroy() end)
  70. pcall(function() Torso.BodyVelocity:Destroy() end)
  71. pcall(function() Torso.BodyPosition:Destroy() end)
  72.  
  73.  
  74. script.Name = name
  75.  
  76. as = {}
  77. as.Cone = "http://www.roblox.com/asset/?id=1033714"
  78. as.Bevel = "rbxasset://fonts/leftarm.mesh"
  79. as.Block = "rbxasset://sounds\\metal.ogg"
  80. as.Hit = "http://www.roblox.com/asset/?id=10209583"
  81. as.QSphere = "http://www.roblox.com/asset/?id=9944765"
  82. as.Headphones = "http://www.roblox.com/asset/?id=1051545"
  83. as.Ring = "http://www.roblox.com/asset/?id=3270017"
  84. as.Rock = "http://www.roblox.com/asset/?id=1290033"
  85. as.RockT = "http://www.roblox.com/asset/?id=1290030"
  86. as.LWing = "http://www.roblox.com/asset/?id=90821133"
  87. as.RWing = "http://www.roblox.com/asset/?id=90821193"
  88. as.WingT = "http://www.roblox.com/asset/?id=92189351"
  89. as.HeatSeekingMissile = "http://www.roblox.com/asset/?id=137991337"
  90. as.TimbaLaugh = "http://www.roblox.com/asset/?id=181368017"
  91.  
  92. for i,v in pairs(as) do
  93. game:GetService("ContentProvider"):Preload(as[i])
  94. end
  95.  
  96.  
  97. iNew=function(tab)
  98. local v=Instance.new(tab[1])
  99. for Ind,Val in pairs(tab) do
  100. if Ind~=1 and Ind~=2 then
  101. v[Ind] = Val
  102. end
  103. end
  104. v.Parent=tab[2]==0 and LastMade or tab[2]
  105. LastMade=v
  106. return v
  107. end
  108.  
  109. iPart=function(tab)
  110. local v=Instance.new(tab.type or "Part")
  111. if tab.type~="CornerWedgePart" then v.formFactor="Custom" end
  112. v.CanCollide=false
  113. v.TopSurface=10 v.BottomSurface=10 v.RightSurface=10 v.LeftSurface=10 v.FrontSurface=10 v.BackSurface=10
  114. v.Size=v3(tab[2],tab[3],tab[4])
  115. if tab.co then v.BrickColor=bn(tab.co) end
  116. if tab.tr then v.Transparency=tab.tr end
  117. if tab.rf then v.Reflectance=tab.rf end
  118. if tab.cf then v.CFrame=tab.cf end
  119. if tab.an then v.Anchored=tab.an end
  120. if tab.mt then v.Material=tab.mt end
  121. if tab.ca then v.CanCollide=tab.ca end
  122. v.Parent=tab[1]
  123. LastMade=v
  124. return v
  125. end
  126.  
  127. function Raycast(Pos,Dir,Dist,tab)
  128. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit *Dist),tab)
  129. end
  130.  
  131. function GetNormal(part,position)
  132. local obj = part.CFrame:pointToObjectSpace(position)
  133. local siz = part.Size/2
  134. for i,v in pairs(Enum.NormalId:GetEnumItems()) do
  135. local vec = Vector3.FromNormalId(v)
  136. local wvec = part.CFrame:vectorToWorldSpace(vec)
  137. local vz = (obj)/(siz*vec)
  138. if (mabs(vz.X-1) < 0.01 or mabs(vz.Y-1) < 0.01 or mabs(vz.Z-1) < 0.01) then
  139. return wvec,vec
  140. end
  141. end
  142. if part.className == "WedgePart" then
  143. local wy = part.Size.y^0.5
  144. local wz = part.Size.z^0.5
  145. return part.CFrame:vectorToWorldSpace(Vector3.new(0,wz,-wy)), Vector3.new(0,wz,-wy)
  146. end
  147. end
  148.  
  149.  
  150. Block=iNew{"NumberValue",Char,Name="Block",Value=0}
  151.  
  152.  
  153. pcall(function() Torso.LAW:Remove() end)
  154. pcall(function() Torso.RAW:Remove() end)
  155. pcall(function() Torso.LLW:Remove() end)
  156. pcall(function() Torso.RLW:Remove() end)
  157. LAW=iNew{"Weld",Torso,Name="LAW",Part0=Torso,C0=cn(-1.5,0.5,0),C1=cn(0,0.5,0)}
  158. RAW=iNew{"Weld",Torso,Name="RAW",Part0=Torso,C0=cn( 1.5,0.5,0),C1=cn(0,0.5,0)}
  159. LLW=iNew{"Weld",Torso,Name="LLW",Part0=Torso,C0=cn(-0.5, -1,0),C1=cn(0, 1,0)}
  160. RLW=iNew{"Weld",Torso,Name="RLW",Part0=Torso,C0=cn( 0.5, -1,0),C1=cn(0, 1,0)}
  161.  
  162. function Arms(on)
  163. LAM.Parent=Torso LAM.Part0=Torso
  164. RAM.Parent=Torso RAM.Part0=Torso
  165. LAM.Part1=on and nil or LA
  166. RAM.Part1=on and nil or RA
  167. LAW.Part1=on and LA or nil
  168. RAW.Part1=on and RA or nil
  169. end
  170.  
  171. function Legs(on)
  172. LLM.Parent=Torso LLM.Part0=Torso
  173. RLM.Parent=Torso RLM.Part0=Torso
  174. LLM.Part1=on and nil or LL
  175. RLM.Part1=on and nil or RL
  176. LLW.Part1=on and LL or nil
  177. RLW.Part1=on and RL or nil
  178. end
  179.  
  180. function GetWeld(weld)
  181. if not weld:FindFirstChild("Angle") then
  182. local a = Instance.new("Vector3Value", weld)
  183. a.Name = "Angle"
  184. local x,y,z=weld.C0:toEulerAnglesXYZ()
  185. a.Value=v3(mdeg(x),mdeg(y),mdeg(z))
  186. end
  187. return weld.C0.p,weld.Angle.Value
  188. end
  189.  
  190. function ClearWeld(weld)
  191. if weld:FindFirstChild"Angle" then
  192. weld.Angle:Remove()
  193. end
  194. end
  195.  
  196. function SetWeld(weld,CC,i, loops, origpos,origangle, nextpos,nextangle,smooth)
  197. local CO="C"..CC
  198. smooth = smooth or 1
  199. if not weld:FindFirstChild("Angle") then
  200. local a = Instance.new("Vector3Value", weld)
  201. a.Name = "Angle"
  202. local x,y,z=weld.C0:toEulerAnglesXYZ()
  203. a.Value=v3(mdeg(x),mdeg(y),mdeg(z))
  204. end
  205.  
  206. local perc
  207. if smooth == 1 then
  208. perc = math.sin((math.pi/2)/loops*i)
  209. else
  210. perc = i/loops
  211. end
  212.  
  213. local tox,toy,toz = 0,0,0
  214. if origangle.x > nextangle.x then
  215. tox = -mabs(origangle.x - nextangle.x) *perc
  216. else
  217. tox = mabs(origangle.x - nextangle.x) *perc
  218. end
  219. if origangle.y > nextangle.y then
  220. toy = -mabs(origangle.y - nextangle.y) *perc
  221. else
  222. toy = mabs(origangle.y - nextangle.y) *perc
  223. end
  224. if origangle.z > nextangle.z then
  225. toz = -mabs(origangle.z - nextangle.z) *perc
  226. else
  227. toz = mabs(origangle.z - nextangle.z) *perc
  228. end
  229.  
  230. local tox2,toy2,toz2 = 0,0,0
  231. if origpos.x > nextpos.x then
  232. tox2 = -mabs(origpos.x - nextpos.x) *perc
  233. else
  234. tox2 = mabs(origpos.x - nextpos.x) *perc
  235. end
  236. if origpos.y > nextpos.y then
  237. toy2 = -mabs(origpos.y - nextpos.y) *perc
  238. else
  239. toy2 = mabs(origpos.y - nextpos.y) *perc
  240. end
  241. if origpos.z > nextpos.z then
  242. toz2 = -mabs(origpos.z - nextpos.z) *perc
  243. else
  244. toz2 = mabs(origpos.z - nextpos.z) *perc
  245. end
  246. weld.Angle.Value = v3(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  247. weld[CO] = cn(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)*ca(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  248. end
  249.  
  250. function PlaySound(sound,pitch,volume,parent)
  251. local newSound = iNew{"Sound",parent or Torso,Pitch=pitch,Volume=volume,Name=sound,SoundId=sound}
  252. newSound:Play()
  253. deb:AddItem(newSound,6)
  254. return newSound
  255. end
  256.  
  257. Trails={}
  258. TrailPack={}
  259. Traili={}
  260. function Trail(obj,ofs,col)
  261. Trails[obj]=true
  262. Traili[#Traili+1]={obj,ofs,col,obj.CFrame*ofs}
  263. end
  264.  
  265. function GetHuman(model)
  266. local foundHum
  267. local foundTorso
  268. local foundHead
  269. if #model:GetChildren()==0 then return end
  270. for i,v in pairs(model:GetChildren()) do
  271. if v:IsA("Humanoid") then
  272. foundHum = v
  273. elseif v.Name == "Torso" then
  274. foundTorso = v
  275. elseif v.Name == "Head" then
  276. foundHead = v
  277. end
  278. end
  279. return foundHum,foundTorso,foundHead
  280. end
  281.  
  282.  
  283. Pack = iNew{"Model",Char,Name="Pack"} p=Pack
  284. cc = {"Bright blue","Bright yellow","Bright orange","Brown","Reddish brown","","Dark stone grey","Black","White","Really black","Brick yellow","Bright green","Br. yellowish green"}
  285.  
  286. -- BACKPACK
  287. Main = iPart{p,1.25,0.5,1.25,co=cc[2]}
  288. iNew{"Weld",p,Part0=Torso,Part1=Main,C0=cn(0,0,0.75)*ca(90,0,0)}
  289. iNew{"CylinderMesh",Main}
  290.  
  291. Bolt = iPart{p,0.75,0.2,0.75,co=cc[6]}
  292. iNew{"Weld",p,Part0=Main,Part1=Bolt,C0=cn(0,0.3,0)}
  293. iNew{"CylinderMesh",Bolt}
  294.  
  295. Boltp = iPart{p,0.75,0.2,0.2,co=cc[7]}
  296. iNew{"Weld",p,Part0=Bolt,Part1=Boltp,C0=cn(0,0.05,0)*ca(0,-30,0)}
  297.  
  298. Start = iPart{p,1.25,0.5,1.25,co=cc[2]}
  299. iNew{"Weld",p,Part0=Main,Part1=Start,C0=cn(0,0,-0.75+0.25/2)}
  300.  
  301. Cyl = iPart{p,1.1,0.5,1.1,co=cc[6]}
  302. iNew{"Weld",p,Part0=Start,Part1=Cyl,C0=cn(0,0,-0.5)*ca(-90,0,0)}
  303. iNew{"CylinderMesh",Cyl}
  304.  
  305. Cylc = iPart{p,1.1,0.5,1.1,co=cc[6]}
  306. iNew{"Weld",p,Part0=Cyl,Part1=Cylc,C0=cn(0,-0.5,0)*ca(180,0,0)}
  307. iNew{"SpecialMesh",Cylc,MeshId=as.Cone,Scale=v3(0.56,0.7,0.56)}
  308.  
  309. Cylt1 = iPart{p,1.4,0.2,1.4,co=cc[6]}
  310. iNew{"Weld",p,Part0=Cyl,Part1=Cylt1,C0=cn(0,0.2,0)}
  311. iNew{"CylinderMesh",Cylt1,Scale=v3(1,1,1)}
  312.  
  313. Cylt2 = iPart{p,1.2,0.2,1.2,co=cc[6]}
  314. wCylt2 = iNew{"Weld",p,Part0=Cylt1,Part1=Cylt2,C0=cn(0,0.15,0)*ca(0,0,0)} -- rotaty
  315. iNew{"CylinderMesh",Cylt2,Scale=v3(1,1,1)}
  316.  
  317. Rotate = iPart{p,0.35,1.8,0.35,co=cc[7]}
  318. wRotate = iNew{"Weld",p,Part0=Cylt2,Part1=Rotate,C0=cn(0,1,0.1)*ca(-30,0,90)} -- rotaty
  319. iNew{"CylinderMesh",Rotate}
  320.  
  321. for i=-1,1,2 do
  322. local tStart = iPart{p,0.2,0.3,0.3,co=cc[2]}
  323. iNew{"Weld",p,Part0=Cylt2,Part1=tStart,C0=cn(0.35*i,0.25,0.1)}
  324.  
  325. if i==-1 then
  326. local Mid1 = iPart{p,0.25,1.3,0.25,co=cc[6]}
  327. iNew{"Weld",p,Part0=Cylt2,Part1=Mid1,C0=cn(0,0.25,0.1)*ca(0,0,90)}
  328. iNew{"CylinderMesh",Mid1}
  329. end
  330.  
  331. local Wed1 = iPart{p,0.3,0.5,0.2,co=cc[2]}
  332. iNew{"Weld",p,Part0=tStart,Part1=Wed1,C0=cn(0,0.4,0)*ca(0,90*i,0)}
  333. iNew{"SpecialMesh",Wed1,MeshType="Wedge"}
  334.  
  335. local Wed2 = iPart{p,0.3,0.3,0.3,co=cc[2]}
  336. iNew{"Weld",p,Part0=Wed1,Part1=Wed2,C0=cn(0,0.1,0.25)*ca(0,180*i,180)}
  337. iNew{"SpecialMesh",Wed2,MeshType="Wedge"}
  338.  
  339. local Cylt = iPart{p,0.4,0.4,0.4,co=cc[2]}
  340. iNew{"Weld",p,Part0=Rotate,Part1=Cylt,C0=cn(0,0.6*i,0)}
  341. iNew{"CylinderMesh",Cylt}
  342.  
  343. local Rotp = iPart{p,0.4,0.5,0.2,co=cc[2]}
  344. iNew{"Weld",p,Part0=Cylt,Part1=Rotp,C0=cn(0.4,0,0)*ca(0,0,-90)}
  345.  
  346. local Rotp2 = iPart{p,0.4,0.5,0.2,co=cc[2]}
  347. iNew{"Weld",p,Part0=Rotp,Part1=Rotp2,C0=cn(0,0.25,-0.1)*ca(30,0,0)*cn(0,0.25,0.1)}
  348.  
  349. if i==-1 then
  350. MidPart = iPart{p,1.6,0.5,0.2,co=cc[2]}
  351. iNew{"Weld",p,Part0=Rotp2,Part1=MidPart,C0=cn(-0.6,0.5,0)}
  352. end
  353.  
  354. local MidWed = iPart{p,0.2,0.4,0.2,co=cc[2]}
  355. iNew{"Weld",p,Part0=MidPart,Part1=MidWed,C0=cn(0.2*i,-0.35,0)*ca(-90,0,90*i)}
  356. iNew{"SpecialMesh",MidWed,MeshType="Wedge"}
  357.  
  358. local MidWedt = iPart{p,0.2,0.4,0.2,co=cc[2]}
  359. iNew{"Weld",p,Part0=MidPart,Part1=MidWedt,C0=cn(0.6*i,0.35,0)*ca(90,0,-90*i)}
  360. iNew{"SpecialMesh",MidWedt,MeshType="Wedge"}
  361.  
  362. if i==-1 then
  363. local Midt = iPart{p,0.8,0.2,0.2,co=cc[2]}
  364. iNew{"Weld",p,Part0=MidPart,Part1=Midt,C0=cn(0,0.35,0)}
  365. end
  366.  
  367. if i==-1 then
  368. for x = 90/6,90,90/6 do
  369. local Headphones = iPart{p,0,0,0,co=cc[2]}
  370. iNew{"Weld",p,Part0=MidPart,Part1=Headphones,C0=cn(0,0.3,-0.4)*ca(x-30,0,0)}
  371. iNew{"SpecialMesh",Headphones,MeshId=as.Headphones}
  372. if x==90/6 then
  373. RotatyThingy = iPart{p,1.1,1.1,1.1,co=cc[1],tr=0.75}
  374. iNew{"Weld",p,Part0=Headphones,Part1=RotatyThingy,C0=cn(0,-0.1,-0.1)}
  375. iNew{"SpecialMesh",RotatyThingy,MeshType="Sphere"}
  376.  
  377. sph = iPart{p,0.5,0.5,0.5,co=cc[9]} sph.Reflectance = 0.75
  378. iNew{"Weld",p,Part0=RotatyThingy,Part1=sph}
  379. iNew{"SpecialMesh",sph,MeshType="Sphere"}
  380.  
  381. Light = iNew{"PointLight",RotatyThingy,Shadows=true,Brightness=2}
  382.  
  383. TopAtt = iPart{p,0.2,0.4,0.2,co=cc[6]}
  384. iNew{"Weld",p,Part0=MidPart,Part1=TopAtt,C0=cn(0,0.95,-0.3)}
  385. iNew{"BlockMesh",TopAtt,Scale=v3(0.5,1,0.5)}
  386.  
  387. TopBar = iPart{p,0.25,0.25,0.6,co=cc[6]}
  388. iNew{"Weld",p,Part0=TopAtt,Part1=TopBar,C0=cn(0,0.2,-0.2)}
  389.  
  390. TopOut = iPart{p,0.3,0.3,0.4,co=cc[2]}
  391. iNew{"Weld",p,Part0=TopBar,Part1=TopOut,C0=cn(0,0,0.15)}
  392.  
  393. TopWed = iPart{p,0.25,0.2,0.25,co=cc[6]}
  394. iNew{"Weld",p,Part0=TopBar,Part1=TopWed,C0=cn(0,0,-0.4)*ca(-90,0,0)}
  395. iNew{"SpecialMesh",TopWed,MeshType="Wedge"}
  396.  
  397. TopHole = iPart{p,1,1,0.2,co=cc[10]}
  398. iNew{"Weld",p,Part0=TopWed,Part1=TopHole,C0=ca(math.deg(math.atan2(0.25,0.2)),0,0)*cn(0,0,-0.01)}
  399. iNew{"BlockMesh",TopHole,Scale=v3(0.15,((0.2^2+0.25^2)^0.5)-0.1,0.1)}
  400. end
  401. end
  402. end
  403.  
  404. for x=0,180,180/5 do
  405. local Armor = iPart{p,0.25,0.5,0.25,co=cc[2]}
  406. iNew{"Weld",p,Part0=Torso,Part1=Armor,C0=ca(0,0,-10*i)*cn(0.6*i,0.75,0)*ca(-x,0,0)*cn(0,0,0.6)}
  407. iNew{"CylinderMesh",Armor}
  408.  
  409. local Plate = iPart{p,0.75,0.5,0.2,co=cc[2],mt="WoodPlanks"}
  410. iNew{"Weld",p,Part0=Armor,Part1=Plate,C0=cn((0.75/2)*i,0,0)}
  411. iNew{"BlockMesh",Plate}
  412.  
  413. if x==0 or x==180 then
  414. local Sph = iPart{p,0.25,0.25,0.25,co=cc[(x==0 and 2 or 6)]}
  415. iNew{"Weld",p,Part0=Armor,Part1=Sph,C0=cn(0,x==0 and -0.25 or 0.75/2,0)}
  416. if x==0 then
  417. iNew{"SpecialMesh",Sph,MeshType="Sphere"}
  418. else
  419. iNew{"CylinderMesh",Sph}
  420. end
  421. end
  422. end
  423. end
  424.  
  425. -- ROCKET ARM
  426. RocketArm = iPart{p,0.5,0.2,0.5,co=cc[2]}
  427. wRocketArm = iNew{"Weld",p,Part0=MidPart,Part1=RocketArm,C0=cn(-0.8,0.2,-0.4)*ca(-20,0,90)} -- rotaty
  428. iNew{"CylinderMesh",RocketArm}
  429.  
  430. Arm1 = iPart{p,0.3,0.4,0.3,co=cc[7]}
  431. iNew{"Weld",p,Part0=RocketArm,Part1=Arm1,C0=cn(-0.2,0.1,0)*ca(0,0,-30)*cn(0.2,0.2,0)}
  432. iNew{"CylinderMesh",Arm1}
  433.  
  434. Arm2 = iPart{p,0.3,0.6,0.3,co=cc[7]}
  435. iNew{"Weld",p,Part0=Arm1,Part1=Arm2,C0=cn(-0.15,0.2,0)*ca(0,0,-45)*cn(0.15,0.3,0)}
  436. iNew{"CylinderMesh",Arm2}
  437.  
  438. Arm3J = iPart{p,0.3,0.3,0.3,co=cc[7]}
  439. iNew{"Weld",p,Part0=Arm2,Part1=Arm3J,C0=cn(0,0.3,0)*ca(0,0,75)}
  440. iNew{"SpecialMesh",Arm3J,MeshType="Sphere"}
  441.  
  442. Arm3 = iPart{p,0.3,0.6,0.3,co=cc[7]}
  443. iNew{"Weld",p,Part0=Arm3J,Part1=Arm3,C0=cn(0,0.3,0)}
  444. iNew{"CylinderMesh",Arm3}
  445.  
  446. ArmC = iPart{p,0,0,0,co=cc[6]}
  447. iNew{"Weld",p,Part0=Arm3,Part1=ArmC,C0=cn(0,0.3,0)*ca(180,0,0)}
  448. iNew{"SpecialMesh",ArmC,MeshId=as.Cone,Scale=v3(0.25,0.5,0.25)}
  449.  
  450. ArmS = iPart{p,0.4,0.4,0.4,co=cc[7]}
  451. iNew{"Weld",p,Part0=ArmC,Part1=ArmS,C0=cn(0,-0.3,0)*ca(160,0,80)}
  452. iNew{"SpecialMesh",ArmS,MeshType="Sphere"}
  453.  
  454. Arm4 = iPart{p,0.3,1.5,0.3,co=cc[6]}
  455. iNew{"Weld",p,Part0=ArmS,Part1=Arm4,C0=cn(0,0.75,0)}
  456. iNew{"CylinderMesh",Arm4}
  457.  
  458. ShA = iPart{p,0.5,0.7,0.5,co=cc[2]}
  459. iNew{"Weld",p,Part0=ArmS,Part1=ShA,C0=cn(0,0.35,0)}
  460. iNew{"CylinderMesh",ShA}
  461.  
  462. ShA2 = iPart{p,0,0,0,co=cc[2]}
  463. iNew{"Weld",p,Part0=ArmS,Part1=ShA2,C0=cn(0,0,0)*ca(0,-110,180)}
  464. iNew{"SpecialMesh",ShA2,MeshId=as.QSphere,Scale=v3(0.5,0.5,0.5)}
  465.  
  466. RocketArm2 = iPart{p,0.4,0.35,0.4,co=cc[6]}
  467. wRocketArm2 = iNew{"Weld",p,Part0=Arm4,Part1=RocketArm2,C0=cn(0,0.75,0)*ca(90,-65,0)} -- rotaty
  468. iNew{"CylinderMesh",RocketArm2}
  469.  
  470. for i=0,180,180/8 do
  471. local ArmP = iPart{p,0.2,0.2,0.3,co=cc[6]}
  472. iNew{"Weld",p,Part0=RocketArm2,Part1=ArmP,C0=cn(0,0,0)*ca(0,30+i,0)*cn(0.35,0,0)}
  473. iNew{"BlockMesh",ArmP,Scale=v3(0.5,0.5,0.5)}
  474. end
  475.  
  476. for i=0,180,180/4 do
  477. local ArmP = iPart{p,0.2,0.2,0.3,co=cc[6]}
  478. iNew{"Weld",p,Part0=RocketArm2,Part1=ArmP,C0=cn(0,0,0)*ca(0,30+i,0)*cn(0.45,0,0)}
  479. iNew{"BlockMesh",ArmP,Scale=v3(0.5,0.5,0.5)}
  480. end
  481.  
  482. ArmP = iPart{p,0.6,0.2,0.3,co=cc[6]}
  483. iNew{"Weld",p,Part0=RocketArm2,Part1=ArmP,C0=ca(0,30,0)}
  484. iNew{"BlockMesh",ArmP,Scale=v3(1,0.5,0.5)}
  485.  
  486. Arm5 = iPart{p,0.3,1.5,0.3,co=cc[6]}
  487. iNew{"Weld",p,Part0=RocketArm2,Part1=Arm5,C0=cn(0,0,-0.75)*ca(-90,0,0)}
  488. iNew{"CylinderMesh",Arm5}
  489.  
  490. ShA = iPart{p,0.5,0.5,0.5,co=cc[2]}
  491. iNew{"Weld",p,Part0=Arm5,Part1=ShA,C0=cn(0,0.25,0)}
  492. iNew{"SpecialMesh",ShA}
  493.  
  494. RocketC = iPart{p,0.5,0.3,0.5,co=cc[6]}
  495. wRocketC = iNew{"Weld",p,Part0=Arm5,Part1=RocketC,C0=cn(0,0.75,0)*ca(0,0,0)} -- rotaty
  496. iNew{"CylinderMesh",RocketC}
  497.  
  498. RocketCo = iPart{p,0,0,0,co=cc[6]}
  499. iNew{"Weld",p,Part0=RocketC,Part1=RocketCo,C0=cn(0,0.205,0)}
  500. iNew{"SpecialMesh",RocketCo,MeshId=as.Cone,Scale=v3(0.243,0.15,0.243)}
  501.  
  502. for i=-1,1,2 do
  503. local Rp = iPart{p,0.2,0.75,0.2,co=cc[6]}
  504. iNew{"Weld",p,Part0=RocketC,Part1=Rp,C0=cn(0.15*i,0,0)*ca(0,0,-60*i)*cn(0,0.75/2,0)}
  505. iNew{"BlockMesh",Rp,Scale=v3(0.5,1,1)}
  506.  
  507. local Rp2 = iPart{p,0.2,0.75,0.2,co=cc[6]}
  508. iNew{"Weld",p,Part0=Rp,Part1=Rp2,C0=cn(0.05*i,0.75/2,0)*ca(0,0,60*i)*cn(-0.05*i,0.75/2,0)}
  509. iNew{"BlockMesh",Rp2,Scale=v3(0.5,1,1)}
  510.  
  511. local Rp3 = iPart{p,0.4,0.2,0.4,co=cc[6]}
  512. iNew{"Weld",p,Part0=Rp2,Part1=Rp3,C0=cn(0,0.75/2,0)*ca(0,0,90)}
  513. iNew{"CylinderMesh",Rp3,Scale=v3(1,1,1)}
  514.  
  515. if i==-1 then
  516. RocketMid = iPart{p,0.3,1.549,0.3,co=cc[6]}
  517. wRocketRot = iNew{"Weld",p,Part0=Rp3,Part1=RocketMid,C0=cn(0,-1.549/2,0)*ca(0,15,0)} -- rotaty
  518. iNew{"CylinderMesh",RocketMid}
  519. end
  520. end
  521.  
  522. for i=-1,1,2 do
  523. local sc = 0.8
  524. local RPart = iPart{p,0.3,(3^0.5)*sc,(1)*sc,co=cc[7]}
  525. iNew{"Weld",p,Part0=RocketMid,Part1=RPart,C0=ca(0,0,90)*cn(-sc/2*i,0,0)*ca(0,90*i,0)}
  526. iNew{"SpecialMesh",RPart,MeshType="Wedge"}
  527. end
  528.  
  529. Barrels = {}
  530. for i=360/3,360,360/3 do
  531. local BStart = iPart{p,0.55,0.3,0.55,co=cc[3]}
  532. iNew{"Weld",p,Part0=RocketMid,Part1=BStart,C0=ca(90,0,180)*cn(-0.2,0.25,0)*ca(0,i,0)*cn(0.33,0,0)}
  533. iNew{"CylinderMesh",BStart}
  534.  
  535. local Barrel = iPart{p,0.55,0.55,0.55,co=cc[7]}
  536. iNew{"Weld",p,Part0=BStart,Part1=Barrel,C0=cn(0,0.85/2,0)}
  537. iNew{"CylinderMesh",Barrel}
  538. table.insert(Barrels,Barrel)
  539.  
  540. local Hole = iPart{p,0.4,0,0.4,co=cc[10]}
  541. iNew{"Weld",p,Part0=Barrel,Part1=Hole,C0=cn(0,0.55/2,0)}
  542. iNew{"CylinderMesh",Hole,Scale=v3(1,0.05,1)}
  543. end
  544.  
  545. -- LASER ARM
  546. LaserArm = iPart{p,0.5,0.2,0.5,co=cc[2]}
  547. wLaserArm = iNew{"Weld",p,Part0=MidPart,Part1=LaserArm,C0=cn(0.8,0.2,-0.4)*ca(-20+180,0,-90)} -- rotaty
  548. iNew{"CylinderMesh",LaserArm}
  549.  
  550. Arm1 = iPart{p,0.3,0.4,0.3,co=cc[7]}
  551. iNew{"Weld",p,Part0=LaserArm,Part1=Arm1,C0=cn(-0.2,0.1,0)*ca(0,0,-30)*cn(0.2,0.2,0)}
  552. iNew{"CylinderMesh",Arm1}
  553.  
  554. Arm2 = iPart{p,0.3,0.6,0.3,co=cc[7]}
  555. iNew{"Weld",p,Part0=Arm1,Part1=Arm2,C0=cn(-0.15,0.2,0)*ca(0,0,-45)*cn(0.15,0.3,0)}
  556. iNew{"CylinderMesh",Arm2}
  557.  
  558. Arm3J = iPart{p,0.3,0.3,0.3,co=cc[7]}
  559. iNew{"Weld",p,Part0=Arm2,Part1=Arm3J,C0=cn(0,0.3,0)*ca(0,0,75)}
  560. iNew{"SpecialMesh",Arm3J,MeshType="Sphere"}
  561.  
  562. Arm3 = iPart{p,0.3,0.6,0.3,co=cc[7]}
  563. iNew{"Weld",p,Part0=Arm3J,Part1=Arm3,C0=cn(0,0.3,0)}
  564. iNew{"CylinderMesh",Arm3}
  565.  
  566. ArmC = iPart{p,0,0,0,co=cc[6]}
  567. iNew{"Weld",p,Part0=Arm3,Part1=ArmC,C0=cn(0,0.3,0)*ca(180,0,0)}
  568. iNew{"SpecialMesh",ArmC,MeshId=as.Cone,Scale=v3(0.25,0.5,0.25)}
  569.  
  570. ArmS = iPart{p,0.4,0.4,0.4,co=cc[7]}
  571. iNew{"Weld",p,Part0=ArmC,Part1=ArmS,C0=cn(0,-0.3,0)*ca(190,0,80)}
  572. iNew{"SpecialMesh",ArmS,MeshType="Sphere"}
  573.  
  574. Arm4 = iPart{p,0.3,1.5,0.3,co=cc[6]}
  575. iNew{"Weld",p,Part0=ArmS,Part1=Arm4,C0=cn(0,0.75,0)}
  576. iNew{"CylinderMesh",Arm4}
  577.  
  578. ShA = iPart{p,0.5,0.7,0.5,co=cc[2]}
  579. iNew{"Weld",p,Part0=ArmS,Part1=ShA,C0=cn(0,0.35,0)}
  580. iNew{"CylinderMesh",ShA}
  581.  
  582. ShA2 = iPart{p,0,0,0,co=cc[2]}
  583. iNew{"Weld",p,Part0=ArmS,Part1=ShA2,C0=cn(0,0,0)*ca(0,-90,180)}
  584. iNew{"SpecialMesh",ShA2,MeshId=as.QSphere,Scale=v3(0.5,0.5,0.5)}
  585.  
  586. LaserArm2 = iPart{p,0.4,0.35,0.4,co=cc[6]}
  587. wLaserArm2 = iNew{"Weld",p,Part0=Arm4,Part1=LaserArm2,C0=cn(0,0.75,0)*ca(90,-65,0)} -- rotaty
  588. iNew{"CylinderMesh",LaserArm2}
  589.  
  590. for i=0,180,180/8 do
  591. local ArmP = iPart{p,0.2,0.2,0.3,co=cc[6]}
  592. iNew{"Weld",p,Part0=LaserArm2,Part1=ArmP,C0=cn(0,0,0)*ca(0,30+i,0)*cn(0.35,0,0)}
  593. iNew{"BlockMesh",ArmP,Scale=v3(0.5,0.5,0.5)}
  594. end
  595.  
  596. for i=0,180,180/4 do
  597. local ArmP = iPart{p,0.2,0.2,0.3,co=cc[6]}
  598. iNew{"Weld",p,Part0=LaserArm2,Part1=ArmP,C0=cn(0,0,0)*ca(0,30+i,0)*cn(0.45,0,0)}
  599. iNew{"BlockMesh",ArmP,Scale=v3(0.5,0.5,0.5)}
  600. end
  601.  
  602. ArmP = iPart{p,0.6,0.2,0.3,co=cc[6]}
  603. iNew{"Weld",p,Part0=LaserArm2,Part1=ArmP,C0=ca(0,30,0)}
  604. iNew{"BlockMesh",ArmP,Scale=v3(1,0.5,0.5)}
  605.  
  606. Arm5 = iPart{p,0.3,1.5,0.3,co=cc[6]}
  607. iNew{"Weld",p,Part0=LaserArm2,Part1=Arm5,C0=cn(0,0,-0.75)*ca(-90,0,0)}
  608. iNew{"CylinderMesh",Arm5}
  609.  
  610. ShA = iPart{p,0.5,0.5,0.5,co=cc[2]}
  611. iNew{"Weld",p,Part0=Arm5,Part1=ShA,C0=cn(0,0.25,0)}
  612. iNew{"SpecialMesh",ShA}
  613.  
  614. LaserC = iPart{p,0.5,0.3,0.5,co=cc[6]}
  615. wLaserC = iNew{"Weld",p,Part0=Arm5,Part1=LaserC,C0=cn(0,0.75,0)*ca(0,0,0)} -- rotaty
  616. iNew{"CylinderMesh",LaserC}
  617.  
  618. LaserCo = iPart{p,0,0,0,co=cc[6]}
  619. iNew{"Weld",p,Part0=LaserC,Part1=LaserCo,C0=cn(0,0.205,0)}
  620. iNew{"SpecialMesh",LaserCo,MeshId=as.Cone,Scale=v3(0.243,0.15,0.243)}
  621.  
  622. for i=-1,1,2 do
  623. local Rp = iPart{p,0.2,0.75,0.2,co=cc[6]}
  624. iNew{"Weld",p,Part0=LaserC,Part1=Rp,C0=cn(0.15*i,0,0)*ca(0,0,-60*i)*cn(0,0.75/2,0)}
  625. iNew{"BlockMesh",Rp,Scale=v3(0.5,1,1)}
  626.  
  627. local Rp2 = iPart{p,0.2,0.75,0.2,co=cc[6]}
  628. iNew{"Weld",p,Part0=Rp,Part1=Rp2,C0=cn(0.05*i,0.75/2,0)*ca(0,0,60*i)*cn(-0.05*i,0.75/2,0)}
  629. iNew{"BlockMesh",Rp2,Scale=v3(0.5,1,1)}
  630.  
  631. local Rp3 = iPart{p,0.4,0.2,0.4,co=cc[6]}
  632. iNew{"Weld",p,Part0=Rp2,Part1=Rp3,C0=cn(0,0.75/2,0)*ca(0,0,90)}
  633. iNew{"CylinderMesh",Rp3,Scale=v3(1,1,1)}
  634.  
  635. if i==-1 then
  636. LaserMid = iPart{p,0.55,1.549,0.55,co=cc[6]}
  637. wLaserRot = iNew{"Weld",p,Part0=Rp3,Part1=LaserMid,C0=cn(0,-1.549/2,0)*ca(0,-15-90,0)} -- rotaty
  638. iNew{"CylinderMesh",LaserMid}
  639. end
  640. end
  641.  
  642. LaserB = iPart{p,1.1,0.9,1.1,co=cc[2]}
  643. iNew{"Weld",p,Part0=LaserMid,Part1=LaserB,C0=cn(0,0,0)*ca(0,0,90)}
  644. iNew{"CylinderMesh",LaserB}
  645.  
  646. for i=-1,1,2 do
  647. local BRing = iPart{p,0,0,0,co=cc[6]}
  648. iNew{"Weld",p,Part0=LaserB,Part1=BRing,C0=cn(0,0.45*i,0)*ca(90,0,0)}
  649. iNew{"SpecialMesh",BRing,MeshId=as.Ring,Scale=v3(1,1,1)}
  650.  
  651. local BRock = iPart{p,0,0,0}
  652. iNew{"Weld",p,Part0=LaserB,Part1=BRock,C0=cn(0,0.5*i,0)*ca(90-90*i,0,0)}
  653. iNew{"SpecialMesh",BRock,MeshId=as.Rock,TextureId=as.RockT,Scale=v3(0.5,0.3,0.5),VertexColor=v3(0,0.8,1)}
  654. end
  655.  
  656. LaserM = iPart{p,0.5,1.5,0.5,co=cc[7]}
  657. iNew{"Weld",p,Part0=LaserB,Part1=LaserM,C0=cn(0,-0.75,0)}
  658. iNew{"CylinderMesh",LaserM}
  659.  
  660. LaserT = iPart{p,0.8,0.3,0.8,co=cc[7]}
  661. iNew{"Weld",p,Part0=LaserM,Part1=LaserT,C0=cn(0,-0.65,0)}
  662. iNew{"CylinderMesh",LaserT}
  663.  
  664. LaserH = iPart{p,0.4,0.3,0.4,co=cc[10]}
  665. iNew{"Weld",p,Part0=LaserT,Part1=LaserH,C0=cn(0,-0.3,0)}
  666. iNew{"CylinderMesh",LaserH}
  667.  
  668. for i=0,360,360/16 do
  669. local LaserW = iPart{p,0.2,0.4,0.2,co=cc[7]}
  670. iNew{"Weld",p,Part0=LaserT,Part1=LaserW,C0=cn(0,-0.35,0)*ca(180,i,0)*cn(0,0,-0.3)}
  671. iNew{"SpecialMesh",LaserW,MeshType="Wedge"}
  672. end
  673.  
  674. BSide = iPart{p,0.2,0.9,0.2,co=cc[6]}
  675. iNew{"Weld",p,Part0=LaserB,Part1=BSide,C0=cn(0,0,1.1/2)*ca(0,0,0)}
  676. iNew{"BlockMesh",BSide,Scale=v3(1,1,0.05)}
  677.  
  678. -- BOOTS OF TRAVEL
  679. for i=-1,1,2 do
  680. local Shin = iPart{p,1.1,0.8,1.1,co=cc[2]}
  681. iNew{"Weld",p,Part0=i==-1 and LL or RL,Part1=Shin,C0=cn(0,-1+0.35,0)}
  682.  
  683. local Toe = iPart{p,0.9,0.3,0.4,co=cc[2]}
  684. iNew{"Weld",p,Part0=Shin,Part1=Toe,C0=cn(0,-0.4+0.15,-1.5/2)}
  685.  
  686. local Wing = iPart{p,0,0,0}
  687. iNew{"Weld",p,Part0=Shin,Part1=Wing,C0=cn(0.55*i,0.4,0.75)*ca(-15,90*i,0)}
  688. iNew{"SpecialMesh",Wing,MeshId=as[(i==-1 and "RWing" or "LWing")],TextureId=as.WingT,Scale=v3(0.8,0.6,1)}
  689.  
  690. for i=-1,1,2 do
  691. local Light = iPart{p,0.2,0.3,0.3,co=cc[1],tr=0.25}
  692. iNew{"Weld",p,Part0=Shin,Part1=Light,C0=cn(0.55*i,0,0)}
  693. iNew{"SpecialMesh",Light,MeshType="Sphere"}
  694. end
  695. end
  696.  
  697. -- HANDHELD BUTTONS
  698. for i=-1,1,2 do
  699. local Handle = iPart{p,0.25,0.8,0.25,co=cc[6]}
  700. iNew{"Weld",p,Part0=i==-1 and LA or RA,Part1=Handle,C0=cn(0,-1,0)*ca(-90,0,0)}
  701. iNew{"CylinderMesh",Handle}
  702.  
  703. for ii=-1,1,2 do
  704. local hp = iPart{p,0.25,0.2,0.35,co=cc[6]}
  705. iNew{"Weld",p,Part0=Handle,Part1=hp,C0=cn(0,0.45*ii,-0.1)}
  706. iNew{"BlockMesh",hp,Scale=v3(1,0.5,1)}
  707.  
  708. local hp2 = iPart{p,0.25,0.2,0.3,co=cc[6]}
  709. iNew{"Weld",p,Part0=hp,Part1=hp2,C0=cn(0,0.05*ii,-0.35/2)*ca(-60*ii,0,0)*cn(0,-0.05*ii,-0.15)}
  710. iNew{"BlockMesh",hp2,Scale=v3(1,0.5,1)}
  711.  
  712. if ii==-1 then
  713. local hp3 = iPart{p,0.25,(0.9-0.15-(3^0.5)*0.15),0.2,co=cc[6]}
  714. iNew{"Weld",p,Part0=Handle,Part1=hp3,C0=cn(0,0,-0.25-0.12)}
  715. iNew{"BlockMesh",hp3,Scale=v3(1,1,0.5)}
  716. end
  717.  
  718. local hp4 = iPart{p,0.25,0.2,0.25,co=cc[7]}
  719. iNew{"Weld",p,Part0=Handle,Part1=hp4,C0=cn(0,0.55*ii,0)*ca(90-90*ii,0,0)}
  720. iNew{"CylinderMesh",hp4,Scale=v3(1,0.5,1)}
  721.  
  722. for iii=-1,1,2 do
  723. local Sph = iPart{p,0,0,0,co=cc[(i==-1 and 2 or i==1 and 1)]}
  724. iNew{"Weld",p,Part0=hp4,Part1=Sph,C0=cn(0,0.05,0)*ca(0,90-90*iii,0)}
  725. iNew{"SpecialMesh",Sph,MeshId=as.QSphere,Scale=v3(0.25,0.25,0.25)}
  726. end
  727. end
  728. end
  729.  
  730. -- SMOKE PIPE
  731. Pipe = iPart{p,0.2,0.4,0.2,co=cc[4]}
  732. iNew{"Weld",p,Part0=Head,Part1=Pipe,C0=cn(-0.1,-0.225,-0.75)*ca(-100,0,15)}
  733. iNew{"CylinderMesh",Pipe,Scale=v3(0.5,1,0.5)}
  734.  
  735. ba = iPart{p,0.2,0.2,0.2,co=cc[4]}
  736. iNew{"Weld",p,Part0=Pipe,Part1=ba,C0=cn(0,0.2,0)*ca(-90,0,0)}
  737. iNew{"SpecialMesh",ba,MeshType="Sphere",Scale=v3(0.5,0.5,0.5)}
  738.  
  739. p2 = iPart{p,0.2,0.4,0.2,co=cc[4]}
  740. iNew{"Weld",p,Part0=ba,Part1=p2,C0=cn(0,0.2,0)}
  741. iNew{"CylinderMesh",p2,Scale=v3(0.5,1,0.5)}
  742.  
  743. ba2 = iPart{p,0.2,0.2,0.2,co=cc[4]}
  744. iNew{"Weld",p,Part0=p2,Part1=ba2,C0=cn(0,0.2,0)*ca(90,0,0)}
  745. iNew{"SpecialMesh",ba2,MeshType="Sphere",Scale=v3(0.5,0.5,0.5)}
  746.  
  747. p3 = iPart{p,0.2,0.3,0.2,co=cc[4]}
  748. iNew{"Weld",p,Part0=ba2,Part1=p3,C0=cn(0,0.15,0)}
  749. iNew{"CylinderMesh",p3,Scale=v3(0.5,1,0.5)}
  750.  
  751. cu = iPart{p,0,0,0,co=cc[4]}
  752. iNew{"Weld",p,Part0=p3,Part1=cu,C0=cn(0,0.15,0.1)*ca(-90,0,0)}
  753. iNew{"SpecialMesh",cu,MeshId=as.Cone,Scale=v3(0.15,0.3,0.15)}
  754.  
  755. ho = iPart{p,0.2,0.2,0.2,co=cc[10]}
  756. iNew{"Weld",p,Part0=cu,Part1=ho,C0=cn(0,-0.115,0)}
  757. iNew{"CylinderMesh",ho,Scale=v3(0.85,0.05,0.85)}
  758.  
  759. Smoke = iNew{"Smoke",ho,Color=bc(cc[6]).Color,Opacity=0.25,RiseVelocity=-3,Size=0,Enabled=false}
  760. -- END BUILDING
  761.  
  762.  
  763. function FindNearest(Amount,Range)
  764. local Players = game:GetService("Players"):GetPlayers()
  765. for i=1,#Players do
  766. if Players[i] == Player then
  767. table.remove(Players,i)
  768. end
  769. end
  770.  
  771. local Nearest = {}
  772. for i=1,#Players>=Amount and Amount or #Players do
  773. local Point = Torso.Position
  774. local NearestMag = Range
  775. local NearestPlr = nil
  776. local NearestInd = nil
  777.  
  778. for _,v in pairs(Players) do
  779. if v.Character and v.Character.Torso and v.Name~="129K" then
  780. local Dist = (v.Character.Torso.Position-Point).magnitude
  781. if Dist<NearestMag then
  782. NearestMag = Dist
  783. NearestPlr = v
  784. NearestInd = _
  785. end
  786. end
  787. end
  788. table.insert(Nearest,NearestPlr)
  789. table.remove(Players,NearestInd)
  790. end
  791. return Nearest
  792. end
  793.  
  794.  
  795. function ShootMissiles()
  796. local Nearest3 = FindNearest(3,120)
  797.  
  798. for i=1,#Nearest3 do
  799. local Missile = iPart{p,0.6,0.6,0.6,co=cc[3],cf=Barrels[i].CFrame*cn(0,Barrels[i].Size.y,0)}
  800. Missile.CanCollide = true
  801. iNew{"CylinderMesh",Missile}
  802. iNew{"Fire",Missile}
  803. iNew{"Smoke",Missile,Color=bn(cc[7]).Color}
  804.  
  805. if i==1 then
  806. local Sound = iNew{"Sound",workspace,SoundId=as.HeatSeekingMissile,Pitch=1}
  807. Sound:Play()
  808. game:GetService("Debris"):AddItem(Sound,5)
  809. end
  810.  
  811. local function Explode()
  812. if Missile.Parent then
  813. iNew{"Explosion",workspace,Position=Missile.Position}
  814. Missile:Destroy()
  815. end
  816. end
  817.  
  818. local RP = iNew{"RocketPropulsion",Missile,CartoonFactor=1,MaxSpeed=150,MaxThrust=10000,MaxTorque=v3(1,1,1)/0,TargetRadius=5,Target=Nearest3[i].Character.Torso}
  819. RP.ReachedTarget:connect(function()
  820. Explode()
  821. end)
  822. RP:Fire()
  823.  
  824. Spawn(function()
  825. wait(10)
  826. Explode()
  827. end)
  828. end
  829. end
  830.  
  831. function ShootLaser()
  832. local Nearest = FindNearest(1,100)
  833.  
  834. for i=1,#Nearest do
  835. local CF = LaserH.CFrame
  836. local CF2 = Nearest[i].Character.Torso.CFrame
  837.  
  838. for t=0,1,0.05 do -- B(t) = (1-t)*B*(p0*p1*p2)*t+t*(B*(p1*p2*p3))*t
  839. local p0 = CF*cn(0,1,0)
  840. local p1 = Torso.CFrame*cn(0,0,-4)
  841. local p2 = CF2*cn(0,0,-1)
  842. local p3 = p2*cn(0,0,-4)
  843.  
  844. local B = 0.05
  845.  
  846. local Part = iPart{workspace,1,1,1,an=true,co=cc[2],cf=p0}
  847. local Part = iPart{workspace,1,1,1,an=true,co=cc[2],cf=p1}
  848. local Part = iPart{workspace,1,1,1,an=true,co=cc[2],cf=p2}
  849. local Part = iPart{workspace,1,1,1,an=true,co=cc[2],cf=p3}
  850.  
  851. local Part = iPart{workspace,0.5,1,0.5,an=true,co=cc[1]}
  852. Part.CFrame = CF*cn(
  853. (1-t)*B*(p0.x*p1.x*p2.x)*t+t*(B*(p1.x*p2.x*p3.x))*t,
  854. (1-t)*B*(p0.y*p1.y*p2.y)*t+t*(B*(p1.y*p2.y*p3.y))*t,
  855. (1-t)*B*(p0.z*p1.z*p2.z)*t+t*(B*(p1.z*p2.z*p3.z))*t
  856. )
  857. end
  858.  
  859. --[[Vector3 CalculateBezierPoint(float t,
  860. Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3)
  861. {
  862. float u = 1 ? t;
  863. float tt = t*t;
  864. float uu = u*u;
  865. float uuu = uu * u;
  866. float ttt = tt * t;
  867.  
  868. Vector3 p = uuu * p0; //first term
  869. p += 3 * uu * t * p1; //second term
  870. p += 3 * u * tt * p2; //third term
  871. p += ttt * p3; //fourth term
  872.  
  873. return p;
  874. }]]
  875.  
  876.  
  877. --[[local Laser = iPart{p,1,1,1,co=cc[1],an=true}
  878. local mLaser = iNew{"CylinderMesh",Laser}
  879.  
  880. local con = game:GetService("RunService").RenderStepped:connect(function()
  881. if Laser.Parent and Nearest[i] and Nearest[i].Character and Nearest[i].Character.Torso then
  882. local Dist = (LaserH.Position-Nearest[i].Character.Torso.Position).magnitude
  883. Laser.CFrame = LaserH.CFrame
  884. Laser.CFrame = cn(LaserH.Position,Nearest[i].Character.Torso.Position) * ca(-90,0,0) * cn(0,Dist/2,0)
  885. mLaser.Scale=v3(0.4,Dist,0.4)
  886. else
  887. con:disconnect()
  888. end
  889. end)]]
  890. end
  891. end
  892.  
  893. keys = {}
  894.  
  895. Mouse.KeyDown:connect(function(key)
  896. keys[key]=true
  897. if key == "q" then
  898. ShootMissiles()
  899. end
  900.  
  901. if key == "e" then
  902. ShootLaser()
  903. end
  904.  
  905. if key == "x" then
  906. local OhhhOhOhHoHoOhhhhhhHAWWWWW = iNew{"Sound",workspace,SoundId=as.TimbaLaugh,Pitch=1}
  907. OhhhOhOhHoHoOhhhhhhHAWWWWW:Play()
  908. game:GetService("Debris"):AddItem(OhhhOhOhHoHoOhhhhhhHAWWWWW,5)
  909. end
  910. end)
  911.  
  912. Mouse.KeyUp:connect(function(key)
  913. keys[key]=false
  914. end)
  915.  
  916.  
  917. Count = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement