Advertisement
memberhero

Untitled

Jan 9th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.79 KB | None | 0 0
  1. --Hand-Cannon Gifted by TheRedAngel, Regular Script!
  2. wait(1)
  3. Players = game:GetService("Players")
  4. Me = Players.LocalPlayer
  5. Char = Me.Character
  6. necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  7. ShootColors = {"Bright yellow", "New Yeller", "Bright orange", "Neon orange", "Really red", "Bright red"}
  8. PlaceId = game.PlaceId
  9. ModelName = "Cannon"
  10. Selected = false
  11. Attacking = false
  12. Accuracy = 10
  13. Debounce = true
  14. Hurt = false
  15. Damage = {50,100}
  16.  
  17. ContentProvider = game:GetService("ContentProvider")
  18.  
  19. V3 = Vector3.new
  20. C3 = Color3.new
  21. BN = BrickColor.new
  22. CN = CFrame.new
  23. CA = CFrame.Angles
  24. MR = math.rad
  25. MRA = math.random
  26. MP = math.pi
  27. MH = math.huge
  28. UD = UDim2.new
  29.  
  30. function RC(Pos, Dir, Max, Ignore)
  31. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999)), Ignore)
  32. end
  33.  
  34. function RayC(Start, En, MaxDist, Ignore)
  35. return RC(Start, (En - Start), MaxDist, Ignore)
  36. end
  37.  
  38. function ComputePos(pos1, pos2)
  39. return CN(pos1, V3(pos2.x, pos1.y, pos2.z))
  40. end
  41.  
  42. function DetectSurface(pos, part)
  43. local surface = nil
  44. local pospos = part.CFrame
  45. local pos2 = pospos:pointToObjectSpace(pos)
  46. local siz = part.Size
  47. local shaep = part.Shape
  48. if shaep == Enum.PartType.Ball or shaep == Enum.PartType.Cylinder then
  49. surface = {"Anything", CN(pospos.p, pos)*CN(0, 0, -(pospos.p - pos).magnitude)*CA(MR(-90), 0, 0)}
  50. else
  51. if pos2.Y > ((siz.Y/2)-0.04) then
  52. surface = {"Top", CA(0, 0, 0)}
  53. elseif pos2.Y < -((siz.Y/2)-0.04) then
  54. surface = {"Bottom", CA(-MP, 0, 0)}
  55. elseif pos2.X > ((siz.X/2)-0.04) then
  56. surface = {"Right", CA(0, 0, MR(-90))}
  57. elseif pos2.X < -((siz.X/2)-0.04) then
  58. surface = {"Left", CA(0, 0, MR(90))}
  59. elseif pos2.Z > ((siz.Z/2)-0.04) then
  60. surface = {"Back", CA(MR(90), 0, 0)}
  61. elseif pos2.Z < -((siz.Z/2)-0.04) then
  62. surface = {"Front", CA(MR(-90), 0, 0)}
  63. end
  64. end
  65. return surface
  66. end
  67.  
  68. function Compute(pos1, pos2)
  69. local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  70. return CN(pos1, pos3)
  71. end
  72.  
  73. function waitChild(n, p)
  74. local c = p:findFirstChild(n)
  75. if c then return c end
  76. while true do
  77. c = p.ChildAdded:wait()
  78. if c.Name == n then return c end
  79. end
  80. end
  81.  
  82. function Notime(func)
  83. coroutine.resume(coroutine.create(function()
  84. func()
  85. end))
  86. end
  87.  
  88. Torso = waitChild("Torso", Char)
  89. Head = waitChild("Head", Char)
  90. Rarm = waitChild("Right Arm", Char)
  91. Larm = waitChild("Left Arm", Char)
  92. Rleg = waitChild("Right Leg", Char)
  93. Lleg = waitChild("Left Leg", Char)
  94. Neck = waitChild("Neck", Torso)
  95. Hum = waitChild("Humanoid", Char)
  96.  
  97. RSH = waitChild("Right Shoulder", Torso)
  98. LSH = waitChild("Left Shoulder", Torso)
  99. RH = waitChild("Right Hip", Torso)
  100. LH = waitChild("Left Hip", Torso)
  101.  
  102. RSH.Part0 = Torso
  103. LSH.Part0 = Torso
  104. RH.Part0 = Torso
  105. LH.Part0 = Torso
  106.  
  107. Add = {
  108. Mesh = function(P, ID, Scale, Tex)
  109. local m = Instance.new("SpecialMesh")
  110. m.MeshType = "FileMesh"
  111. m.MeshId = ID or ""
  112. m.Scale = Scale or V3(1, 1, 1)
  113. m.TextureId = Tex or ""
  114. m.Parent = P
  115. return m
  116. end,
  117. Sphere = function(P, Scale)
  118. local m = Instance.new("SpecialMesh")
  119. m.MeshType = "Sphere"
  120. m.Scale = Scale or V3(1, 1, 1)
  121. m.Parent = P
  122. return m
  123. end
  124. }
  125.  
  126. Sounds = {
  127. Shoot = {Id = "http://www.roblox.com/asset/?id=2697431", Pitch = 0.3, Volume = 0.5},
  128. Boom = {Id = "http://www.roblox.com/asset/?id=2692806", Pitch = 0.55, Volume = 0.4},
  129. Slash = {Id = "rbxasset://sounds//swordslash.wav", Pitch = 0.5, Volume = 0.5},
  130. Hit = {Id = "http://www.roblox.com/asset/?id=2801263", Pitch = 0.85, Volume = 0.35},
  131. Reload = {Id = "rbxasset://sounds\\metal.ogg", Pitch = 1, Volume = 0.45},
  132. }
  133.  
  134. for _,v in pairs(Sounds) do
  135. ContentProvider:Preload(v.Id)
  136. end
  137.  
  138. function PlaySound(Sound, bool)
  139. local s = Instance.new("Sound")
  140. s.Looped = false
  141. s.Volume = Sound.Volume
  142. s.SoundId = Sound.Id
  143. if bool then
  144. s.Pitch = MRA((Sound.Pitch*0.75)*1000, (Sound.Pitch*1.15)*1000)/1000
  145. else
  146. s.Pitch = Sound.Pitch
  147. end
  148. s.PlayOnRemove = true
  149. s.Parent = Torso
  150. Notime(function()
  151. wait()
  152. s.Parent = nil
  153. end)
  154. end
  155.  
  156. function GetParts(pos, dist)
  157. local parts = {}
  158. local function o(p)
  159. for _,v in pairs(p:children()) do
  160. if v:IsA("BasePart") then
  161. if (pos - v.Position).magnitude <= dist then
  162. table.insert(parts, {v, (pos - v.Position).magnitude, v.Anchored})
  163. end
  164. end
  165. o(v)
  166. end
  167. end
  168. o(workspace)
  169. return parts
  170. end
  171.  
  172. function GetHum(P)
  173. for _,v in pairs(P:children()) do
  174. if v:IsA("Humanoid") then
  175. if v.Health > 0 then
  176. return v
  177. end
  178. end
  179. end
  180. end
  181.  
  182. function GetGroup(Pos, Distance, Hit)
  183. local tab = {}
  184. for _,v in pairs(workspace:children()) do
  185. local h = GetHum(v)
  186. local t = v:findFirstChild("Torso")
  187. if h and t and v ~= Hit.Parent then
  188. if (t.Position - Pos).magnitude <= Distance then
  189. table.insert(tab, {h, v, (t.Position - Pos).magnitude})
  190. end
  191. end
  192. end
  193. if Hit then
  194. local h = GetHum(Hit.Parent)
  195. if h then
  196. table.insert(tab, {h, Hit.Parent, 0})
  197. end
  198. end
  199. return tab
  200. end
  201.  
  202. function Tag(hum)
  203. if PlaceId == 48513881 then
  204. local tag = Instance.new("ObjectValue")
  205. tag.Name = "creator"
  206. tag.Value = Me
  207. tag.Parent = hum
  208. end
  209. end
  210.  
  211. function Part(Par, Anc, Colli, Tran, Ref, Col, Siz)
  212. local p = Instance.new("Part")
  213. p.formFactor = "Custom"
  214. p.TopSurface = 0
  215. p.BottomSurface = 0
  216. p.Transparency = Tran
  217. p.Reflectance = Ref
  218. p.Anchored = Anc
  219. p.CanCollide = Colli
  220. p.BrickColor = Col
  221. p.Size = Siz
  222. p.Locked = true
  223. p.Parent = Par
  224. p:BreakJoints()
  225. return p
  226. end
  227.  
  228. function Weld(P0, P1, C0, C1)
  229. local w = Instance.new("Weld")
  230. w.Part0 = P0
  231. w.Part1 = P1
  232. if C0 then
  233. w.C0 = C0
  234. end
  235. if C1 then
  236. w.C1 = C1
  237. end
  238. w.Parent = P0
  239. return w
  240. end
  241.  
  242. for _,v in pairs(Char:children()) do
  243. if v.Name == "Hand Cannon" then
  244. v:remove()
  245. end
  246. end
  247.  
  248. Model = Instance.new("Model")
  249. Model.Name = "Hand Cannon"
  250.  
  251. FTorso = Part(Model, false, false, 1, 0, Torso.BrickColor, V3(2, 2, 1))
  252. FW = Weld(Torso, FTorso)
  253.  
  254. RAB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  255. LAB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  256. RLB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  257. LLB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  258.  
  259. RABW = Weld(Torso, RAB, CN(), CN(-1.5, -0.5, 0))
  260. LABW = Weld(Torso, LAB, CN(), CN(1.5, -0.5, 0))
  261. RLBW = Weld(Torso, RLB, CN(), CN(-0.5, 1, 0))
  262. LLBW = Weld(Torso, LLB, CN(), CN(0.5, 1, 0))
  263.  
  264. RAW = Weld(RAB, nil, CN(), CN(0, 0.5, 0))
  265. LAW = Weld(LAB, nil, CN(), CN(0, 0.5, 0))
  266. RLW = Weld(RLB, nil, CN(), CN(0, 1, 0))
  267. LLW = Weld(LLB, nil, CN(), CN(0, 1, 0))
  268.  
  269. TW = Weld(Torso, nil, CN(0.7, 0.8, 1.2), CA(0, MR(180), MR(55)))
  270.  
  271. Weapon = Instance.new("Model")
  272. Weapon.Name = "Cannon"
  273.  
  274. HB = Part(Weapon, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  275. HBW = Weld(Rarm, HB, CN(0, -0.7, 0), CA(0, MR(90), MR(90)))
  276. HW = Weld(HB, nil)
  277.  
  278. Handle = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(0.5, 0.5, 0.3))
  279. Add.Mesh(Handle, "http://www.roblox.com/asset/?id=3270017", V3(1, 0.7, 2.2), "")
  280. TW.Part1 = Handle
  281.  
  282. Main = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(1.5, 1.5, 2.5))
  283. Add.Mesh(Main, "http://www.roblox.com/asset/?id=3270017", V3(1.6, 1.6, 15), "")
  284. Weld(Handle, Main, CA(0, MR(90), MR(90)), CN(1, 0, 0.2))
  285.  
  286. Main2 = Part(Weapon, false, false, 0, 0, BN("Gun metallic"), V3(1, 1, 1.5))
  287. Add.Mesh(Main2, "http://www.roblox.com/asset/?id=3270017", V3(1.2, 1.2, 8), "")
  288. Weld(Main, Main2, CN(), CN(0, 0, 1.7))
  289.  
  290. Handle2 = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(0.5, 0.5, 0.3))
  291. Add.Mesh(Handle2, "http://www.roblox.com/asset/?id=3270017", V3(0.7, 0.8, 2.2), "")
  292. Weld(Main2, Handle2, CA(0, MR(90), MR(90)), CN(-0.65, 0, 0))
  293.  
  294. Tip = Part(Weapon, false, false, 0, 0, BN("Earth yellow"), V3(1.6, 1.6, 0.6))
  295. Add.Sphere(Tip, V3(1.05, 1.05, 1))
  296. Weld(Main, Tip, CN(), CN(0, 0, -1.15))
  297.  
  298. Tip4 = Part(Weapon, false, false, 0, 0, BN("Black"), V3(1.2, 1.2, 0.3))
  299. Add.Mesh(Tip4, "http://www.roblox.com/asset/?id=3270017", V3(1.7, 1.7, 10), "")
  300. Weld(Main, Tip4, CN(), CN(0, 0, -0.15))
  301.  
  302. for i = 1.3, 1.45, 0.1 do
  303. local Tip3 = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(1.2, 1.2, 0.3))
  304. Add.Mesh(Tip3, "http://www.roblox.com/asset/?id=3270017", V3(i, i, 2), "")
  305. Weld(Main2, Tip3, CN(), CN(0, 0, 0.6))
  306. end
  307.  
  308. for i = -0.95, 0.66, 1.55 do
  309. local Tip3 = Part(Weapon, false, false, 0, 0, BN("Dark Curry"), V3(1.2, 1.2, 0.3))
  310. Add.Mesh(Tip3, "http://www.roblox.com/asset/?id=3270017", V3(1.65, 1.65, 3), "")
  311. Weld(Main, Tip3, CN(), CN(0, 0, i))
  312. end
  313.  
  314. for i = 1.3, 1.5, 0.1 do
  315. local Tip2 = Part(Weapon, false, false, 0, 0, BN("Earth yellow"), V3(1.6, 1.6, 0.6))
  316. Add.Mesh(Tip2, "http://www.roblox.com/asset/?id=3270017", V3(i, i, 2), "")
  317. Weld(Main, Tip2, CN(), CN(0, 0, 1.1))
  318. end
  319.  
  320. for i = -0.3, 1, 0.15 do
  321. local p = Part(Weapon, false, false, 0.7, 0, BN("Black"), V3(0.2, 0.2, 0.2))
  322. Add.Sphere(p, V3(6, 6, 2))
  323. Weld(Main2, p, CN(0, 0, i))
  324. end
  325.  
  326. function Show_Damage(P, D)
  327. local mo = Instance.new("Model")
  328. mo.Name = "- "..D
  329. local p = Part(mo, false, false, 0, 0, BN("Bright red"), V3(0.2, 0.2, 0.2))
  330. p.Name = "Head"
  331. local m = Instance.new("SpecialMesh")
  332. m.MeshType = "Brick"
  333. m.Scale = Vector3.new(4.5, 2.3, 4.5)
  334. m.Parent = p
  335. local bp = Instance.new("BodyPosition", p)
  336. bp.maxForce = V3(MH, MH, MH)
  337. bp.P = 9001
  338. bp.position = CN(P) * CN(0, 1.5, 0).p
  339. local h = Instance.new("Humanoid")
  340. h.Health = 0
  341. h.MaxHealth = 0
  342. h.Name = "asd"
  343. h.Parent = mo
  344. local nah = true
  345. mo.Parent = workspace
  346. p.CFrame = CN(P)
  347. Notime(function()
  348. wait(1.5)
  349. for i = 0, 1, 0.05 do
  350. p.Transparency = i
  351. if nah then mo.Name = "" nah = false else mo.Name = "- "..D nah = true end
  352. wait()
  353. end
  354. mo:remove()
  355. end)
  356. end
  357.  
  358. function Kill(hit)
  359. if Debounce and Hurt then
  360. local Hu = GetHum(hit.Parent)
  361. if Hu then
  362. Debounce = false
  363. local Dmg = MRA(Damage[1], Damage[2])
  364. Hu.Health = Hu.Health - Dmg
  365. Show_Damage(Tip.Position, Dmg)
  366. PlaySound(Sounds.Hit, true)
  367. Tag(Hu)
  368. local chance = MRA(1, 10)
  369. if chance >=5 then
  370. Hu.PlatformStand = true
  371. wait(0.15)
  372. hit.Velocity = (CN(Torso.CFrame * CN(0, 0.5, 0).p, hit.Position).lookVector * 45)
  373. hit.RotVelocity = V3(MRA(-10, 10), MRA(-10, 10), MRA(-10, 10))
  374. wait(0.3)
  375. Hu.PlatformStand = false
  376. end
  377. end
  378. end
  379. end
  380.  
  381. if Me.PlayerGui:findFirstChild("manaGUI",true) ~= nil then
  382. Me.PlayerGui:findFirstChild("manaGUI",true).Parent = nil
  383. end
  384.  
  385. mana = 400
  386.  
  387. local fengui = Instance.new("GuiMain")
  388. fengui.Parent = Me.PlayerGui
  389. fengui.Name = "manaGUI"
  390. local fenframe = Instance.new("Frame")
  391. fenframe.Parent = fengui
  392. fenframe.BackgroundColor3 = Color3.new(255,255,255)
  393. fenframe.BackgroundTransparency = 1
  394. fenframe.BorderColor3 = Color3.new(17,17,17)
  395. fenframe.Size = UDim2.new(0.0500000007, 0, 0.100000001, 0)
  396. local fentext = Instance.new("TextLabel")
  397. fentext.Parent = fenframe
  398. fentext.Text = "Mana("..mana..")"
  399. fentext.BackgroundTransparency = 1
  400. fentext.SizeConstraint = "RelativeXY"
  401. fentext.TextXAlignment = "Center"
  402. fentext.TextYAlignment = "Center"
  403. fentext.Position = UDim2.new(0,80,1,200)
  404. local fentext2 = Instance.new("TextLabel")
  405. fentext2.Parent = fenframe
  406. fentext2.Text = " "
  407. fentext2.BackgroundTransparency = 0
  408. fentext2.BackgroundColor3 = Color3.new(0,0,1)
  409. fentext2.SizeConstraint = "RelativeXY"
  410. fentext2.TextXAlignment = "Center"
  411. fentext2.TextYAlignment = "Center"
  412. fentext2.Position = UDim2.new(0,10,1,170)
  413. fentext2.Size = UDim2.new(2.79999995,0,0.210000306,0)
  414. local fentext3 = Instance.new("TextLabel")
  415. fentext3.Parent = fenframe
  416. fentext3.Text = " "
  417. fentext3.BackgroundTransparency = 0
  418. fentext3.BackgroundColor3 = Color3.new(1,1,0)
  419. fentext3.SizeConstraint = "RelativeXY"
  420. fentext3.TextXAlignment = "Center"
  421. fentext3.TextYAlignment = "Center"
  422. fentext3.Position = UDim2.new(0,10,1,170)
  423. fentext3.Size = UDim2.new(mana*0.007,0,0.400000006,0)
  424. --2.9000001, 0}, {0.450000018, 0}
  425. local gairo = Instance.new("BodyGyro")
  426. gairo.Parent = nil
  427. gairo.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  428. gairo.P = 20e+003
  429.  
  430. Main.Touched:connect(Kill)
  431.  
  432. Weapon.Parent = Model
  433. Model.Parent = Char
  434.  
  435. if script.Parent.className ~= "HopperBin" then
  436. h = Instance.new("HopperBin", Me.Backpack)
  437. h.Name = ModelName
  438. script.Parent = h
  439. end
  440.  
  441. bin = script.Parent
  442.  
  443. function Attach(t)
  444. RSH.Part0 = t
  445. LSH.Part0 = t
  446. RH.Part0 = t
  447. LH.Part0 = t
  448. RABW.Part0 = t
  449. LABW.Part0 = t
  450. LLBW.Part0 = t
  451. RLBW.Part0 = t
  452. if t == Torso then
  453. FTorso.Transparency = 1
  454. else
  455. Torso.Transparency = 1
  456. end
  457. t.Transparency = 0
  458. end
  459.  
  460. function SelectAnim()
  461. RAW.Part1 = Rarm
  462. for i = 0.25, 1, 0.25 do
  463. RAW.C0 = CA(MR(-10*i), 0, MR(-5*i))
  464. wait()
  465. end
  466. for i = 0.1, 1, 0.1 do
  467. RAW.C0 = CA(MR(-10-90*i), 0, MR(-5-30*i))
  468. wait()
  469. end
  470. for i = 0.5, 1, 0.5 do
  471. RAW.C0 = CA(MR(-100-5*i), 0, MR(-35))
  472. wait()
  473. end
  474. HW.Part1 = Handle
  475. HW.C0 = CA(MR(50), 0, MR(-37))
  476. TW.Part1 = nil
  477. Attach(FTorso)
  478. LAW.Part1 = Larm
  479. for i = 0.25, 1, 0.25 do
  480. RAW.C0 = CA(MR(-105+10*i), 0, MR(-35+5*i))
  481. LAW.C0 = CA(MR(15*i), 0, MR(5*i))
  482. FW.C0 = CA(0, MR(-5*i), 0)
  483. HW.C0 = CA(MR(50-5*i), 0, MR(-37))
  484. wait()
  485. end
  486. for i = 0.06, 1, 0.06 do
  487. RAW.C0 = CA(MR(-95+95*i), MR(35*i), MR(-30+50*i))
  488. LAW.C0 = CA(MR(15+25*i), 0, MR(5+15*i)) * CN(0, -0.4*i, 0)
  489. FW.C0 = CA(0, MR(-5-30*i), 0)
  490. HW.C0 = CA(MR(45), 0, MR(-37+15*i))
  491. wait()
  492. end
  493. Hum.WalkSpeed = 10
  494. for i = 0.1, 1, 0.1 do
  495. RAW.C0 = CA(MR(15*i), MR(35+10*i), MR(20+8*i))
  496. LAW.C0 = CA(MR(40+7*i), 0, MR(20+6*i)) * CN(0, -0.4-0.2*i, 0)
  497. FW.C0 = CA(0, MR(-35-10*i), 0)
  498. HW.C0 = CA(MR(45-11*i), 0, MR(-22+15*i))
  499. wait()
  500. end
  501. for i = 0.25, 1, 0.25 do
  502. RAW.C0 = CA(MR(15+5*i), MR(45+5*i), MR(28+2*i))
  503. LAW.C0 = CA(MR(47+3*i), 0, MR(26+4*i)) * CN(0, -0.6, 0)
  504. FW.C0 = CA(0, MR(-45-5*i), 0)
  505. HW.C0 = CA(MR(34-4*i), 0, MR(-7+7*i))
  506. wait()
  507. end
  508. end
  509.  
  510. function DeselAnim()
  511. for i = 0.25, 1, 0.25 do
  512. RAW.C0 = CA(MR(20-5*i), MR(50-5*i), MR(30-5*i))
  513. LAW.C0 = CA(MR(50-5*i), 0, MR(30-5*i)) * CN(0, -0.6+0.1*i, 0)
  514. FW.C0 = CA(0, MR(-50+5*i), 0)
  515. HW.C0 = CA(MR(30+5*i), 0, MR(-10*i))
  516. wait()
  517. end
  518. for i = 0.15, 1, 0.15 do
  519. RAW.C0 = CA(MR(15-30*i), MR(45-10*i), MR(25-5*i))
  520. LAW.C0 = CA(MR(45-20*i), 0, MR(25-15*i)) * CN(0, -0.5+0.2*i, 0)
  521. FW.C0 = CA(0, MR(-45+10*i), 0)
  522. HW.C0 = CA(MR(35+10*i), 0, MR(-10-15*i))
  523. wait()
  524. end
  525. for i = 0.12, 1, 0.12 do
  526. RAW.C0 = CA(MR(-15-70*i), MR(35-30*i), MR(20-30*i))
  527. LAW.C0 = CA(MR(25-25*i), 0, MR(10-10*i)) * CN(0, -0.3+0.3*i, 0)
  528. FW.C0 = CA(0, MR(-35+20*i), 0)
  529. HW.C0 = CA(MR(45+5*i), 0, MR(-25-12*i))
  530. wait()
  531. end
  532. LAW.Part1 = nil
  533. HW.C0 = CA(MR(50), 0, MR(-37))
  534. for i = 0.25, 1, 0.25 do
  535. RAW.C0 = CA(MR(-85-20*i), MR(5-5*i), MR(-10-25*i))
  536. FW.C0 = CA(0, MR(-15+15*i), 0)
  537. wait()
  538. end
  539. Attach(Torso)
  540. HW.Part1 = nil
  541. TW.Part1 = Handle
  542. Hum.WalkSpeed = 16
  543. for i = 0.15, 1, 0.15 do
  544. RAW.C0 = CA(MR(-105+95*i), 0, MR(-35+30*i))
  545. wait()
  546. end
  547. for i = 0.33, 1, 0.33 do
  548. RAW.C0 = CA(MR(-10+10*i), 0, MR(-5+5*i))
  549. wait()
  550. end
  551. RAW.Part1 = nil
  552. end
  553.  
  554. --Norms:
  555. --RAW.C0 = CA(MR(20), MR(50), MR(30))
  556. --LAW.C0 = CA(MR(50), 0, MR(30)) * CN(0, -0.6, 0)
  557. --FW.C0 = CA(0, MR(-50), 0)
  558. --HW.C0 = CA(MR(30), 0, 0)
  559. --
  560. --
  561.  
  562. function Explode(Par, Pos, surface)
  563. Notime(function()
  564. local cf = CN(Pos) * CA(Par.CFrame:toEulerAnglesXYZ()) * surface[2] * CN(0, 1, 0)
  565. if surface[1] == "Anything" then
  566. cf = surface[2]
  567. end
  568. local col = Par.BrickColor.Color
  569. local r, g, b = col.r, col.g, col.b
  570. local col1, col2, col3 = C3(MRA(r*60, r*100)/100, MRA(g*60, g*100)/100, MRA(b*60, b*100)/100), C3(MRA(r*60, r*100)/100, MRA(g*60, g*100)/100, MRA(b*60, b*100)/100), C3(MRA(r*60, r*100)/100, MRA(g*60, g*100)/100, MRA(b*60, b*100)/100)
  571. local p = Part(workspace, true, false, 0, 0, BN(col1.r, col1.g, col1.b), V3(0.2, 0.2, 0.2))
  572. local p2 = Part(workspace, true, false, 0, 0, BN(col2.r, col2.g, col2.b), V3(0.2, 0.2, 0.2))
  573. local p3 = Part(workspace, true, false, 0, 0, BN(col3.r, col3.g, col3.b), V3(0.2, 0.2, 0.2))
  574. p.CFrame = cf
  575. p2.CFrame = cf
  576. p3.CFrame = cf
  577. local m = Add.Mesh(p, "http://www.roblox.com/asset/?id=20329976", V3(1, 1, 1))
  578. local m2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=20329976", V3(1, 1, 1))
  579. local m3 = Add.Mesh(p3, "http://www.roblox.com/asset/?id=20329976", V3(1, 1, 1))
  580. for i = -0.2, 1, 0.12 do
  581. p2.Transparency = i+0.1
  582. p.Transparency = i
  583. p3.Transparency = i+0.2
  584. m.Scale = V3(1+2.5*i, 1.4+1*i, 1+2.5*i)
  585. m2.Scale = V3(0.8+2*i, 1.2+1*i, 0.8+2*i)
  586. m3.Scale = V3(0.5+1*i, 1+1*i, 0.5+1*i)
  587. wait()
  588. end
  589. p2:remove()
  590. p3:remove()
  591. p:remove()
  592. end)
  593. end
  594.  
  595. function Shoot(Pos)
  596. coroutine.resume(coroutine.create(function()
  597. local acc = Accuracy*100
  598. local Start = Main2.CFrame * CN(0, 0, -0.5).p
  599. local Face = CN(Start, Pos) * CA(MR(MRA(-acc, acc))/100, MR(MRA(-acc, acc))/100, MR(MRA(-acc, acc))/100)
  600. local Cannonball = Part(Model, true, false, 0, 0, BN("Black"), V3(1.3, 1.3, 1.3))
  601. Add.Sphere(Cannonball)
  602. Cannonball.CFrame = Face
  603. local Go = 3
  604. local Drop = 0.55/(Go*3)
  605. local Dist = 500
  606. local lastP = Start
  607. local omg = 0
  608. for i = Go, Dist, Go do
  609. Drop = Drop + 1/(Go*3)
  610. omg = omg + Drop
  611. local dropping = CA(MR(-Drop), 0, 0)
  612. if omg > 130 then
  613. dropping = CN()
  614. end
  615. Face = Face * dropping * CN(0, 0, -Go)
  616. Cannonball.CFrame = Face
  617. local Magn = (Face.p - lastP).magnitude
  618. local T = Part(Model, true, false, 0.1, 0, BN("Mid gray"), V3(0.2, 1, 0.2))
  619. local M = Instance.new("SpecialMesh",T)
  620. M.MeshType = "Head"
  621. M.Scale = V3(5, Magn, 5)
  622. T.CFrame = CN(lastP, Face.p) * CA(MR(-90), 0, 0) * CN(0, Magn/2, 0)
  623. Notime(function()
  624. wait(0.1)
  625. for i = 0.1, 1, 0.1 do
  626. T.Transparency = i+0.1
  627. M.Scale = V3(5-5*i, Magn+0.5, 5-5*i)
  628. wait()
  629. end
  630. T:remove()
  631. end)
  632. local Hit, Hitpos = RayC(lastP, Face.p, Go*2, Char)
  633. lastP = Face.p
  634. if Hit then
  635. PlaySound(Sounds.Boom, true)
  636. local s = DetectSurface(Hitpos, Hit)
  637. Explode(Hit, Hitpos, s)
  638. Cannonball.CFrame = CN(Hitpos)
  639. local hu = GetHum(Hit.Parent)
  640. if hu == nil and Hit.Parent.className ~= "Hat" and Hit.Anchored then
  641. coroutine.resume(coroutine.create(function()
  642. wait(10)
  643. for i = 0, 1, 0.04 do
  644. Cannonball.Transparency = i
  645. wait()
  646. end
  647. Cannonball:remove()
  648. end))
  649. else
  650. Cannonball:remove()
  651. end
  652. local Noobs = GetGroup(Hitpos, 5, Hit)
  653. for _,v in pairs(Noobs) do
  654. local dm = 60/((v[3]+3)/3)
  655. dm = MRA(dm*0.9, dm*1.04)
  656. v[1].Health = v[1].Health - dm
  657. local t = v[2]:findFirstChild("Head")
  658. if t then
  659. Show_Damage(t.Position, dm)
  660. end
  661. pcall(function()
  662. Tag(v[1])
  663. end)
  664. end
  665. local Parts = GetParts(Hitpos, 7)
  666. for _,v in pairs(Parts) do
  667. if v[3] == false then
  668. Notime(function()
  669. if v[1].Name == "Brick wall" then
  670. v[1]:BreakJoints()
  671. v[1].Velocity = (CN(Hitpos, v[1].Position).lookVector * (110/((v[2]+2)/3)))
  672. wait(0.1)
  673. v[1].Velocity = (CN(Hitpos, v[1].Position).lookVector * (110/((v[2]+2)/3)))
  674. else
  675. v[1].Velocity = (CN(Hitpos, v[1].Position).lookVector * (80/((v[2]+2)/3)))
  676. end
  677. end)
  678. end
  679. end
  680. break
  681. end
  682. wait()
  683. end
  684. end))
  685. end
  686.  
  687. function ShootAnim(pos)
  688. RLW.Part1 = Rleg
  689. LLW.Part1 = Lleg
  690. local cf = ComputePos(Torso.Position, pos)
  691. local bp = Instance.new("BodyPosition",Torso)
  692. bp.maxForce = V3(MH, 0, MH)
  693. bp.P = 10000
  694. PlaySound(Sounds.Shoot, true)
  695. local effect = Part(Model, false, false, 0, 0, BN(ShootColors[MRA(1,#ShootColors)]), V3(0.2, 0.2, 0.2))
  696. local effect2 = Part(Model, false, false, 0, 0, BN(ShootColors[MRA(1,#ShootColors)]), V3(0.2, 0.2, 0.2))
  697. local m1 = Add.Mesh(effect, "http://www.roblox.com/asset/?id=20329976", V3(1,1,1))
  698. local m2 = Add.Mesh(effect2, "http://www.roblox.com/asset/?id=20329976", V3(1,1,1))
  699. local w1 = Weld(Main2, effect, CA(MR(-90), 0, 0), CN(0, -1, 0))
  700. local w2 = Weld(Main2, effect2, CA(MR(-90), 0, 0), CN(0, -1, 0))
  701. for i = 0, 1, 0.5 do
  702. RAW.C0 = CA(MR(20-50*i), MR(50-25*i), MR(30+45*i))
  703. LAW.C0 = CA(MR(50-10*i), 0, MR(30+20*i)) * CN(0, -0.6-0.3*i, 0)
  704. RLW.C0 = CA(MR(30*i), 0, MR(-15*i))
  705. LLW.C0 = CA(MR(10*i), 0, MR(-35*i))
  706. FW.C0 = CA(MR(5*i), MR(-50-15*i), 0)
  707. HW.C0 = CA(MR(30), MR(35*i), MR(-25*i))
  708. Neck.C0 = necko * CA(MR(10*i), 0, 0)
  709. bp.position = cf * CN(0, 0, 3*i).p
  710. m1.Scale = V3(0.5+0.6*i, 0.4+0.2*i, 0.5+0.6*i)
  711. m2.Scale = V3(0.3+0.5*i, 0.5+1*i, 0.3+0.5*i)
  712. w1.C1 = CN(0, -1-0.2*i, 0)
  713. w2.C1 = CN(0, -1-0.5*i, 0)
  714. effect.Transparency = 0.2*i
  715. effect2.Transparency = 0.2*i
  716. wait()
  717. end
  718. for i = 0.2, 1, 0.2 do
  719. RAW.C0 = CA(MR(-30-10*i), MR(25-5*i), MR(75+5*i))
  720. LAW.C0 = CA(MR(40-5*i), 0, MR(50+5*i)) * CN(0, -0.9-0.05*i, 0)
  721. RLW.C0 = CA(MR(30+5*i), 0, MR(-15))
  722. LLW.C0 = CA(MR(10+5*i), 0, MR(-35-5*i))
  723. FW.C0 = CA(MR(5+5*i), MR(-65-5*i), 0)
  724. HW.C0 = CA(MR(30), MR(35+5*i), MR(-25-5*i))
  725. Neck.C0 = necko * CA(MR(10+5*i), 0, 0)
  726. bp.position = cf * CN(0, 0, 3+1*i).p
  727. m1.Scale = V3(1+1*i, 0.7+0.9*i, 1+1*i)
  728. m2.Scale = V3(0.8+0.6*i, 1.5+1.6*i, 0.8+0.6*i)
  729. w1.C1 = CN(0, -1.2-0.6*i, 0)
  730. w2.C1 = CN(0, -1.5-1.8*i, 0)
  731. effect.Transparency = 0.2+0.9*i
  732. effect2.Transparency = 0.2+0.9*i
  733. wait()
  734. end
  735. effect:remove()
  736. effect2:remove()
  737. for i = 0.2, 1, 0.2 do
  738. bp.position = cf * CN(0, 0, 4+0.8*i).p
  739. wait()
  740. end
  741. for i = 0.08, 1, 0.06 do
  742. RAW.C0 = CA(MR(-40+50*i), MR(20+15*i), MR(80-35*i))
  743. LAW.C0 = CA(MR(35-30*i), 0, MR(55-45*i)) * CN(0, -0.95+0.5*i, 0)
  744. RLW.C0 = CA(MR(35-35*i), 0, MR(-15+25*i))
  745. LLW.C0 = CA(MR(15-15*i), 0, MR(-40+30*i))
  746. FW.C0 = CA(MR(10-7*i), MR(-70+40*i), 0)
  747. HW.C0 = CA(MR(30), MR(40-40*i), MR(-30-10*i))
  748. Neck.C0 = necko * CA(MR(15+5*i), 0, MR(20*i))
  749. bp.position = cf * CN(0, 0, 4.8+0.8*i).p
  750. wait()
  751. end
  752. bp:remove()
  753. for i = 0.33, 1, 0.33 do
  754. RAW.C0 = CA(MR(10+10*i), MR(35+5*i), MR(45-5*i))
  755. LAW.C0 = CA(MR(5), 0, MR(10)) * CN(0, -0.45+0.1*i, 0)
  756. FW.C0 = CA(MR(3-3*i), MR(-30+5*i), 0)
  757. HW.C0 = CA(MR(30), 0, MR(-40-10*i))
  758. wait()
  759. end
  760. for i = 0.12, 1, 0.12 do
  761. RAW.C0 = CA(MR(20+5*i), MR(40+5*i), MR(40+5*i))
  762. LAW.C0 = CA(MR(5), 0, MR(10)) * CN(0, -0.35-0.3*i, 0)
  763. FW.C0 = CA(0, MR(-25+5*i), 0)
  764. HW.C0 = CA(MR(30), 0, MR(-50-5*i))
  765. wait()
  766. end
  767. local b = Part(Model, false, false, 0, 0, BN("Black"), V3(1.1, 1.1, 1.1))
  768. local m = Add.Sphere(b)
  769. local w = Weld(Larm, b, CN(), CN(0, 1.4, 0))
  770. for i = 0.16, 1, 0.16 do
  771. LAW.C0 = CA(MR(5+30*i), 0, MR(10+10*i)) * CN(0, -0.65+0.65*i, 0)
  772. RAW.C0 = CA(MR(25), MR(45+3*i), MR(40))
  773. m.Scale = V3(0.5+0.5*i, 0.5+0.5*i, 0.5+0.5*i)
  774. Neck.C0 = necko * CA(MR(20-10*i), 0, MR(20-15*i))
  775. wait()
  776. end
  777. for i = 0.1, 1, 0.1 do
  778. LAW.C0 = CA(MR(35+105*i), 0, MR(20+20*i)) * CN(0, -0.9*i, 0)
  779. RAW.C0 = CA(MR(25), MR(48+6*i), MR(40))
  780. Neck.C0 = necko * CA(MR(10-10*i), 0, MR(5-35*i))
  781. wait()
  782. end
  783. for i = 0.16, 1, 0.16 do
  784. LAW.C0 = CA(MR(140-10*i), 0, MR(40-15*i)) * CN(0, -0.9-0.2*i, 0)
  785. RAW.C0 = CA(MR(25), MR(54), MR(40))
  786. Neck.C0 = necko * CA(MR(5*i), 0, MR(-30))
  787. w.C0 = CN(1.5*i, 0.55*i, 1.1*i)
  788. wait()
  789. end
  790. PlaySound(Sounds.Reload, true)
  791. b:remove()
  792. w:remove()
  793. for i = 0.2, 1, 0.2 do
  794. LAW.C0 = CA(MR(130-10*i), 0, MR(25-15*i)) * CN(0, -1.1+0.2*i, 0)
  795. RAW.C0 = CA(MR(25-10*i), MR(54), MR(40))
  796. Neck.C0 = necko * CA(MR(5-3*i), 0, MR(-30+5*i))
  797. HW.C0 = CA(MR(30), 0, MR(-55+10*i))
  798. FW.C0 = CA(0, MR(-20-5*i), 0)
  799. wait()
  800. end
  801. for i = 0.11, 1, 0.11 do
  802. LAW.C0 = CA(MR(120-60*i), 0, MR(10+15*i)) * CN(0, -0.9+0.3*i, 0)
  803. RAW.C0 = CA(MR(15+5*i), MR(54-4*i), MR(40-10*i))
  804. Neck.C0 = necko * CA(MR(2-2*i), 0, MR(-25+25*i))
  805. HW.C0 = CA(MR(30), 0, MR(-45+45*i))
  806. FW.C0 = CA(0, MR(-25-20*i), 0)
  807. RLW.C0 = CA(0, 0, MR(10-8*i))
  808. LLW.C0 = CA(0, 0, MR(-10+8*i))
  809. wait()
  810. end
  811. Neck.C0 = necko
  812. for i = 0.25, 1, 0.25 do
  813. LAW.C0 = CA(MR(60-10*i), 0, MR(25+5*i)) * CN(0, -0.6, 0)
  814. RAW.C0 = CA(MR(20), MR(50), MR(30))
  815. HW.C0 = CA(MR(30), 0, 0)
  816. FW.C0 = CA(0, MR(-45-5*i), 0)
  817. RLW.C0 = CA(0, 0, MR(2-2*i))
  818. LLW.C0 = CA(0, 0, MR(-2+2*i))
  819. wait()
  820. end
  821. RLW.Part1 = nil
  822. LLW.Part1 = nil
  823. RAW.C0 = CA(MR(20), MR(50), MR(30))
  824. LAW.C0 = CA(MR(50), 0, MR(30)) * CN(0, -0.6, 0)
  825. FW.C0 = CA(0, MR(-50), 0)
  826. HW.C0 = CA(MR(30), 0, 0)
  827. Neck.C0 = necko
  828. end
  829.  
  830. function Melee()
  831. PlaySound(Sounds.Slash, true)
  832. for i = 0.25, 1, 0.25 do
  833. RAW.C0 = CA(MR(20+5*i), MR(50-5*i), MR(30+3*i))
  834. LAW.C0 = CA(MR(50), 0, MR(30+4*i)) * CN(0, -0.6-0.05*i, 0)
  835. HW.C0 = CA(MR(30), MR(5*i), 0)
  836. FW.C0 = CA(0, MR(-50-5*i), 0)
  837. wait()
  838. end
  839. for i = 0.12, 1, 0.12 do
  840. RAW.C0 = CA(MR(25+25*i), MR(45-30*i), MR(33+7*i))
  841. LAW.C0 = CA(MR(50), 0, MR(34+11*i)) * CN(0, -0.65-0.25*i, 0)
  842. HW.C0 = CA(MR(30), MR(5+25*i), 0)
  843. FW.C0 = CA(0, MR(-55-25*i), 0)
  844. wait()
  845. end
  846. for i = 0.33, 1, 0.33 do
  847. RAW.C0 = CA(MR(50+15*i), MR(15-5*i), MR(40-10*i)) * CN(0, -0.2*i, 0)
  848. LAW.C0 = CA(MR(50+10*i), 0, MR(45-5*i)) * CN(0, -0.9+0.15*i, 0)
  849. HW.C0 = CA(MR(30+2*i), MR(30+5*i), 0)
  850. FW.C0 = CA(0, MR(-80+10*i), MR(-5*i))
  851. wait()
  852. end
  853. Hurt = true
  854. Debounce = true
  855. for i = 0.07, 1, 0.07 do
  856. RAW.C0 = CA(MR(65+55*i), MR(10), MR(30-70*i)) * CN(0, -0.2-1.1*i, 0)
  857. LAW.C0 = CA(MR(60+120*i), 0, MR(40-70*i)) * CN(0, -0.75+0.7*i, 0)
  858. HW.C0 = CA(MR(32+6*i), MR(35+20*i), MR(-4*i))
  859. FW.C0 = CA(0, MR(-70+110*i), 0)
  860. wait()
  861. end
  862. for i = 0.16, 1, 0.16 do
  863. RAW.C0 = CA(MR(120+10*i), MR(10), MR(-40-5*i)) * CN(0, -1.3-0.1*i, 0)
  864. LAW.C0 = CA(MR(180+15*i), 0, MR(-30-20*i)) * CN(0, -0.05+0.1*i, 0)
  865. HW.C0 = CA(MR(38+2*i), MR(55-6*i), MR(-4-1*i))
  866. FW.C0 = CA(0, MR(40+10*i), 0)
  867. wait()
  868. end
  869. Hurt = false
  870. for i = 0.2, 1, 0.2 do
  871. RAW.C0 = CA(MR(130+5*i), MR(10), MR(-45-2*i)) * CN(0, -1.4-0.05*i, 0)
  872. LAW.C0 = CA(MR(195+5*i), 0, MR(-50-8*i)) * CN(0, 0.05+0.05*i, 0)
  873. HW.C0 = CA(MR(40), MR(49-2*i), MR(-5))
  874. FW.C0 = CA(0, MR(50+3*i), 0)
  875. wait()
  876. end
  877. wait(0.2)
  878. for i = 0.2, 1, 0.2 do
  879. RAW.C0 = CA(MR(135-10*i), MR(10+5*i), MR(-47+10*i)) * CN(0, -1.45+0.25*i, 0)
  880. LAW.C0 = CA(MR(200-10*i), 0, MR(-58+10*i)) * CN(0, 0.1-0.1*i, 0)
  881. HW.C0 = CA(MR(40), MR(47-5*i), MR(-5+5*i))
  882. FW.C0 = CA(0, MR(53-10*i), 0)
  883. wait()
  884. end
  885. for i = 0.08, 1, 0.08 do
  886. RAW.C0 = CA(MR(125-90*i), MR(15+30*i), MR(-37+57*i)) * CN(0, -1.2+1.1*i, 0)
  887. LAW.C0 = CA(MR(190-125*i), 0, MR(-48+68*i)) * CN(0, -0.5*i, 0)
  888. HW.C0 = CA(MR(40-7*i), MR(42-37*i), 0)
  889. FW.C0 = CA(0, MR(43-82*i), 0)
  890. wait()
  891. end
  892. for i = 0.2, 1, 0.2 do
  893. RAW.C0 = CA(MR(35-15*i), MR(45+5*i), MR(20+10*i)) * CN(0, -0.1+0.1*i, 0)
  894. LAW.C0 = CA(MR(65-15*i), 0, MR(20+10*i)) * CN(0, -0.5-0.1*i, 0)
  895. HW.C0 = CA(MR(33-3*i), MR(5-5*i), 0)
  896. FW.C0 = CA(0, MR(-41-9*i), 0)
  897. wait()
  898. end
  899. RLW.Part1 = nil
  900. LLW.Part1 = nil
  901. RAW.C0 = CA(MR(20), MR(50), MR(30))
  902. LAW.C0 = CA(MR(50), 0, MR(30)) * CN(0, -0.6, 0)
  903. FW.C0 = CA(0, MR(-50), 0)
  904. HW.C0 = CA(MR(30), 0, 0)
  905. Neck.C0 = necko
  906. end
  907.  
  908. function onSelected(mouse)
  909. SelectAnim()
  910. Selected = true
  911. mouse.Button1Down:connect(function()
  912. if Attacking == false then
  913. Attacking = true
  914. mouse.Button1Up:wait()
  915. Shoot(mouse.Hit.p)
  916. ShootAnim(mouse.Hit.p)
  917. Attacking = false
  918. end
  919. end)
  920. mouse.KeyDown:connect(function(key)
  921. key = key:lower()
  922. if key == "q" then
  923. if Attacking == false then
  924. Attacking = true
  925. Melee()
  926. Attacking = false
  927. end
  928. end
  929. end)
  930. end
  931.  
  932. function onDeselected(mouse)
  933. Selected = false
  934. DeselAnim()
  935. end
  936.  
  937. bin.Selected:connect(onSelected)
  938. bin.Deselected:connect(onDeselected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement