Advertisement
mathmasterphil

Midieval

Mar 21st, 2015
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.80 KB | None | 0 0
  1. local Me = game.Players.LocalPlayer
  2. local char = Me.Character
  3. local Torso = char.Torso
  4. local Rarm = char["Right Arm"]
  5. local Larm = char["Left Arm"]
  6. local Attkin = true
  7. local ammomag = 500
  8. local mainDamage = 35
  9. local reloadtime = 0.5
  10. local ammo = 0
  11. local click = 0
  12. local anim = false
  13.  
  14. function prop(part, color, Parent, x, y, z)
  15. pp = part
  16. pp.Size = Vector3.new(x, y, z)
  17. pp.BrickColor = BrickColor.new(color)
  18. pp.Parent = Parent
  19. pp.CanCollide = false
  20. pp:BreakJoints()
  21. end
  22.  
  23. function weld(parent, a, b, d)
  24. local ww = Instance.new("Weld")
  25. ww.Parent = parent
  26. ww.Part0 = a
  27. ww.Part1 = b
  28. ww.C1 = d
  29. end
  30.  
  31. function meshp(part, x, y, z)
  32. local mesh = Instance.new("CylinderMesh")
  33. mesh.Parent = part  
  34. mesh.Scale = Vector3.new(x, y, z)
  35. end
  36.  
  37. function mesh(part, type, x, y, z)
  38. local mesh = Instance.new("SpecialMesh")
  39. mesh.MeshType = type
  40. mesh.Parent = part  
  41. mesh.Scale = Vector3.new(x, y, z)
  42. end
  43.  
  44. pcall(function() char[":P"]:remove() end)
  45. pcall(function() char.Guns:remove() end)
  46. local Model = Instance.new("Model",char)
  47. Model.Name = ":P"
  48. local modl = Instance.new("Model")
  49. modl.Parent = char
  50. modl.Name = "Guns"
  51.  
  52. local RAB = Instance.new("Part") -- Right Arm Brick
  53. RAB.formFactor = "Custom"
  54. RAB.Size = Vector3.new(0.2, 0.2, 0.2)
  55. RAB.Transparency = 1
  56. RAB.Parent = Model
  57. RAB:BreakJoints()
  58. local RABW = Instance.new("Weld",RAB) -- Right Arm Brick Weld
  59. RABW.Part0 = Torso
  60. RABW.Part1 = RAB
  61. RABW.C1 = CFrame.new(-1.5, -0.5, 0)
  62. local LAB = Instance.new("Part") -- Right Arm Brick
  63. LAB.formFactor = "Custom"
  64. LAB.Size = Vector3.new(0.2, 0.2, 0.2)
  65. LAB.Transparency = 1
  66. LAB.Parent = Model
  67. LAB:BreakJoints()
  68. local LABW = Instance.new("Weld",LAB) -- Left Arm Brick Weld
  69. LABW.Part0 = Torso
  70. LABW.Part1 = LAB
  71. LABW.C1 = CFrame.new(1.5, -0.5, 0)
  72. local RAW = Instance.new("Weld",RAB) -- Right Arm Weld
  73. RAW.Part0 = RAB
  74. RAW.Part1 = nil
  75. RAW.C1 = CFrame.new(0, 0.5, 0)
  76. local LAW = Instance.new("Weld",LAB) -- Left Arm Weld
  77. LAW.Part0 = LAB
  78. LAW.Part1 = nil
  79. LAW.C1 = CFrame.new(0, 0.5, 0)
  80.  
  81. local handlea = Instance.new("Part")
  82. prop(handlea, "Reddish brown", modl, 1, 1, 1)
  83. mesh(handlea, "Brick", 0.25, 0.35, 0.75)
  84. weld(handlea, handlea, char.Torso, CFrame.new(1.1, -1.5, 0) * CFrame.Angles(0, 0, 0))
  85. local handleac = Instance.new("Part")
  86. prop(handleac, "Mid stone grey", modl, 1, 1, 1)
  87. mesh(handleac, "Brick", 0.25, 1.25, 0.25)
  88. weld(handleac, handleac, handlea, CFrame.new(0, -0.5, -0.5) * CFrame.Angles(0, 0, 0))
  89. local handleaf = Instance.new("Part")
  90. prop(handleaf, "Mid stone grey", modl, 1, 1, 1)
  91. mesh(handleaf, "Brick", 0.15, 0.15, 0.15)
  92. weld(handleaf, handleaf, handlea, CFrame.new(0, -1, -0.5) * CFrame.Angles(0, 0, 0))
  93. local handlead = Instance.new("Part")
  94. prop(handlead, "Mid stone grey", modl, 1, 1, 1)
  95. mesh(handlead, "Brick", 0.05, 0.15, 0.05)
  96. weld(handlead, handlead, handlea, CFrame.new(0, -0.25, -0.1) * CFrame.Angles(0, 0, 0))
  97. local handlead = Instance.new("Part")
  98. prop(handlead, "Mid stone grey", modl, 1, 1, 1)
  99. mesh(handlead, "Brick", 0.05, 0.15, 0.05)
  100. weld(handlead, handlead, handlea, CFrame.new(0, -0.4, -0.14) * CFrame.Angles(0.5, 0, 0))
  101. local handlead = Instance.new("Part")
  102. prop(handlead, "Mid stone grey", modl, 1, 1, 1)
  103. mesh(handlead, "Brick", 0.05, 0.05, 0.25)
  104. weld(handlead, handlead, handlea, CFrame.new(0, -0.46, -0.29) * CFrame.Angles(0, 0, 0))
  105. local handlead = Instance.new("Part")
  106. prop(handlead, "Mid stone grey", modl, 1, 1, 1)
  107. mesh(handlead, "Brick", 0.05, 0.05, 0.15)
  108. weld(handlead, handlead, handlea, CFrame.new(0, -0.25, -0.3) * CFrame.Angles(0.5, 0, 0))
  109. local handleb = Instance.new("Part")
  110. prop(handleb, "Reddish brown", modl, 1, 1, 1)
  111. mesh(handleb, "Brick", 0.25, 0.35, 0.75)
  112. weld(handleb, handleb, char.Torso, CFrame.new(-1.1, -1.5, 0) * CFrame.Angles(0, 0, 0))
  113. local handlebc = Instance.new("Part")
  114. prop(handlebc, "Mid stone grey", modl, 1, 1, 1)
  115. mesh(handlebc, "Brick", 0.25, 1.25, 0.25)
  116. weld(handlebc, handlebc, handleb, CFrame.new(0, -0.5, -0.5) * CFrame.Angles(0, 0, 0))
  117. local handlebf = Instance.new("Part")
  118. prop(handlebf, "Mid stone grey", modl, 1, 1, 1)
  119. mesh(handlebf, "Brick", 0.15, 0.15, 0.15)
  120. weld(handlebf, handlebf, handleb, CFrame.new(0, -1, -0.5) * CFrame.Angles(0, 0, 0))
  121. local handlebd = Instance.new("Part")
  122. prop(handlebd, "Mid stone grey", modl, 1, 1, 1)
  123. mesh(handlebd, "Brick", 0.05, 0.15, 0.05)
  124. weld(handlebd, handlebd, handleb, CFrame.new(0, -0.25, -0.1) * CFrame.Angles(0, 0, 0))
  125. local handlebd = Instance.new("Part")
  126. prop(handlebd, "Mid stone grey", modl, 1, 1, 1)
  127. mesh(handlebd, "Brick", 0.05, 0.15, 0.05)
  128. weld(handlebd, handlebd, handleb, CFrame.new(0, -0.4, -0.14) * CFrame.Angles(0.5, 0, 0))
  129. local handlebd = Instance.new("Part")
  130. prop(handlebd, "Mid stone grey", modl, 1, 1, 1)
  131. mesh(handlebd, "Brick", 0.05, 0.05, 0.25)
  132. weld(handlebd, handlebd, handleb, CFrame.new(0, -0.46, -0.29) * CFrame.Angles(0, 0, 0))
  133. local handlebd = Instance.new("Part")
  134. prop(handlebd, "Mid stone grey", modl, 1, 1, 1)
  135. mesh(handlebd, "Brick", 0.05, 0.05, 0.15)
  136. weld(handlebd, handlebd, handleb, CFrame.new(0, -0.25, -0.3) * CFrame.Angles(0.5, 0, 0))
  137.  
  138. local handaw = handlea.Weld
  139. local handbw = handleb.Weld
  140.  
  141. if script.Parent.className ~= "HopperBin" then
  142.     local h = Instance.new("HopperBin", Me.Backpack)
  143.     h.Name = "Dual gun"
  144.     script.Parent = h
  145. end
  146.  
  147. local bin = script.Parent
  148.  
  149. function onSelected(mouse)
  150. RAW.Part1 = Rarm
  151. LAW.Part1 = Larm
  152.  
  153. handaw.Part1 = Rarm
  154. handbw.Part1 = Larm
  155. handaw.C1 = CFrame.new(0, -1.1, 0) * CFrame.Angles(0, 0, 0)
  156. handbw.C1 = CFrame.new(0, -1.1, 0) * CFrame.Angles(0, 0, 0)
  157.  
  158. for i = 0, 1, 0.1 do
  159. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90*i), 0, 0)
  160. LAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90*i), 0, 0)
  161. wait()
  162. end
  163. Attkin = false
  164.     mouse.Button1Down:connect(function()
  165. if Attkin == false and anim == false then
  166. if ammo > 0 then
  167. ammo = ammo - 1
  168. Attkin = true
  169. local pos1 = handleaf.Position
  170. local pos2 = mouse.hit.p
  171. local shot = Instance.new("Part")
  172. shot.Parent = workspace
  173. shot.formFactor = "Custom"
  174. shot.Anchored = true
  175. shot.BrickColor = BrickColor.new("Bright yellow")
  176. shot.Size = Vector3.new(1, 1, 1)
  177. shot.CanCollide = false
  178. shot.CFrame = CFrame.new((pos1 + pos2) / 2, pos2)
  179. local mesh = Instance.new("BlockMesh")
  180. mesh.Parent = shot
  181. mesh.Scale = Vector3.new(0.1, 0.1, (pos1 - pos2).magnitude)
  182. for _, v in pairs(game.Players:GetChildren()) do
  183. if v.Name == mouse.Target.Parent.Name then
  184. v.Character.Humanoid:TakeDamage(mainDamage)
  185. end
  186. end
  187. wait(0.5)
  188. shot:remove()
  189. click = 1
  190. Attkin = false
  191. end
  192. end
  193.     end)
  194.     mouse.KeyDown:connect(function(key)
  195.         if key == "r" then
  196. if Attkin == false and ammomag > 0 then
  197. if ammo == 0 then
  198. Attkin = true
  199. ammomag = ammomag - 10
  200. ammo = 10
  201. for i = 0, 1, 0.1 do
  202. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-90*i), 0, 0)
  203. LAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-90*i), 0, 0)
  204. wait()
  205. end
  206. wait(reloadtime/2)
  207. local mag1 = handlea:clone()
  208. mag1.Parent = workspace
  209. mag1.CanCollide = true
  210. mag1:BreakJoints()
  211. local mag2 = handleb:clone()
  212. mag2.Parent = workspace
  213. mag2.CanCollide = true
  214. mag2:BreakJoints()
  215. wait(reloadtime/2)
  216. for i = 0, 1, 0.1 do
  217. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90*i), 0, 0)
  218. LAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90*i), 0, 0)
  219. wait()
  220. end
  221. Attkin = false
  222. end
  223. end
  224.     end
  225.         if key == "g" then
  226. if Attkin == false then
  227. for _, v in pairs(game.Players:GetChildren()) do
  228. if v.Name == mouse.Target.Parent.Name then
  229. bin.Parent = v.Backpack
  230. prts.Parent = v.Character
  231. Model.Parent = v.Character
  232. end
  233. end
  234. Attkin = false  
  235. end
  236.     end
  237.         if key == "q" then
  238. if Attkin == false and ammo == 10 then
  239. if anim == false then
  240. Attkin = true
  241. for i = 0, 1, 0.1 do
  242. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-0*i), math.rad(75*i), 0)
  243. LAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-0*i), math.rad(-75*i), 0)
  244. wait()
  245. end
  246. local pos1 = handleaf.Position
  247. local pos2 = mouse.hit.p
  248. local pos3 = handlebf.Position
  249. local pos4 = mouse.hit.p
  250. local shot = Instance.new("Part")
  251. shot.Parent = workspace
  252. shot.Anchored = true
  253. shot.formFactor = "Custom"
  254. shot.BrickColor = BrickColor.new("Bright red")
  255. shot.Size = Vector3.new(1, 1, 1)
  256. shot.CanCollide = false
  257. shot.CFrame = CFrame.new((pos1 + pos2) / 2, pos2)
  258. local shot2 = Instance.new("Part")
  259. shot2.Parent = workspace
  260. shot2.Anchored = true
  261. shot2.formFactor = "Custom"
  262. shot2.BrickColor = BrickColor.new("Bright red")
  263. shot2.Size = Vector3.new(1, 1, 1)
  264. shot2.CanCollide = false
  265. shot2.CFrame = CFrame.new((pos3 + pos4) / 2, pos4)
  266. local mesh = Instance.new("BlockMesh")
  267. mesh.Parent = shot
  268. mesh.Scale = Vector3.new(0.1, 0.1, (pos1 - pos2).magnitude)
  269. local mesh2 = Instance.new("BlockMesh")
  270. mesh2.Parent = shot2
  271. mesh2.Scale = Vector3.new(0.1, 0.1, (pos3 - pos4).magnitude)
  272. for _, v in pairs(game.Players:GetChildren()) do
  273. if v.Name == mouse.Target.Parent.Name then
  274. v.Character.Humanoid:TakeDamage(mainDamage*3)
  275. end
  276. end
  277. for i = 0, 1, 0.1 do
  278. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-0*i), math.rad(75-75*i), 0)
  279. LAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-0*i), math.rad(-75+75*i), 0)
  280. wait()
  281. end
  282. ammo = ammo - 10
  283. shot:remove()
  284. shot2:remove()
  285. Attkin = false
  286. end
  287. end
  288. end
  289.         if key == "t" then
  290. if Attkin == false and ammo == 10 then
  291. Attkin = true
  292. for i = 0, 1, 0.1 do
  293. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-0*i), math.rad(75*i), 0)
  294. LAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-0*i), math.rad(-75*i), 0)
  295. wait()
  296. end
  297. local pos1 = handleaf.Position
  298. local pos2 = mouse.hit.p
  299. local pos3 = handlebf.Position
  300. local pos4 = mouse.hit.p
  301. local shot = Instance.new("Part")
  302. shot.Parent = workspace
  303. shot.Anchored = true
  304. shot.formFactor = "Custom"
  305. shot.BrickColor = BrickColor.new("Bright yellow")
  306. shot.Size = Vector3.new(1, 1, 1)
  307. shot.CanCollide = false
  308. shot.CFrame = CFrame.new((pos1 + pos2) / 2, pos2)
  309. local shot2 = Instance.new("Part")
  310. shot2.Parent = workspace
  311. shot2.Anchored = true
  312. shot2.formFactor = "Custom"
  313. shot2.BrickColor = BrickColor.new("Bright yellow")
  314. shot2.Size = Vector3.new(1, 1, 1)
  315. shot2.CanCollide = false
  316. shot2.CFrame = CFrame.new((pos3 + pos4) / 2, pos4)
  317. local mesh = Instance.new("BlockMesh")
  318. mesh.Parent = shot
  319. mesh.Scale = Vector3.new(0.1, 0.1, (pos1 - pos2).magnitude)
  320. local mesh2 = Instance.new("BlockMesh")
  321. mesh2.Parent = shot2
  322. mesh2.Scale = Vector3.new(0.1, 0.1, (pos3 - pos4).magnitude)
  323. for _, v in pairs(game.Players:GetChildren()) do
  324. if v.Name == mouse.Target.Parent.Name then
  325. v.Character.Humanoid:TakeDamage(mainDamage/2)
  326. end
  327. end
  328. wait(0.5)
  329. shot:remove()
  330. shot2:remove()
  331. local pos1 = handleaf.Position
  332. local pos2 = mouse.hit.p
  333. local pos3 = handlebf.Position
  334. local pos4 = mouse.hit.p
  335. local shot = Instance.new("Part")
  336. shot.Parent = workspace
  337. shot.Anchored = true
  338. shot.formFactor = "Custom"
  339. shot.BrickColor = BrickColor.new("Bright yellow")
  340. shot.Size = Vector3.new(1, 1, 1)
  341. shot.CanCollide = false
  342. shot.CFrame = CFrame.new((pos1 + pos2) / 2, pos2)
  343. local shot2 = Instance.new("Part")
  344. shot2.Parent = workspace
  345. shot2.Anchored = true
  346. shot2.formFactor = "Custom"
  347. shot2.BrickColor = BrickColor.new("Bright yellow")
  348. shot2.Size = Vector3.new(1, 1, 1)
  349. shot2.CanCollide = false
  350. shot2.CFrame = CFrame.new((pos3 + pos4) / 2, pos4)
  351. local mesh = Instance.new("BlockMesh")
  352. mesh.Parent = shot
  353. mesh.Scale = Vector3.new(0.1, 0.1, (pos1 - pos2).magnitude)
  354. local mesh2 = Instance.new("BlockMesh")
  355. mesh2.Parent = shot2
  356. mesh2.Scale = Vector3.new(0.1, 0.1, (pos3 - pos4).magnitude)
  357. for _, v in pairs(game.Players:GetChildren()) do
  358. if v.Name == mouse.Target.Parent.Name then
  359. v.Character.Humanoid:TakeDamage(mainDamage/2)
  360. end
  361. end
  362. wait(0.5)
  363. shot:remove()
  364. shot2:remove()
  365. local pos1 = handleaf.Position
  366. local pos2 = mouse.hit.p
  367. local pos3 = handlebf.Position
  368. local pos4 = mouse.hit.p
  369. local shot = Instance.new("Part")
  370. shot.Parent = workspace
  371. shot.Anchored = true
  372. shot.formFactor = "Custom"
  373. shot.BrickColor = BrickColor.new("Bright yellow")
  374. shot.Size = Vector3.new(1, 1, 1)
  375. shot.CanCollide = false
  376. shot.CFrame = CFrame.new((pos1 + pos2) / 2, pos2)
  377. local shot2 = Instance.new("Part")
  378. shot2.Parent = workspace
  379. shot2.Anchored = true
  380. shot2.formFactor = "Custom"
  381. shot2.BrickColor = BrickColor.new("Bright yellow")
  382. shot2.Size = Vector3.new(1, 1, 1)
  383. shot2.CanCollide = false
  384. shot2.CFrame = CFrame.new((pos3 + pos4) / 2, pos4)
  385. local mesh = Instance.new("BlockMesh")
  386. mesh.Parent = shot
  387. mesh.Scale = Vector3.new(0.1, 0.1, (pos1 - pos2).magnitude)
  388. local mesh2 = Instance.new("BlockMesh")
  389. mesh2.Parent = shot2
  390. mesh2.Scale = Vector3.new(0.1, 0.1, (pos3 - pos4).magnitude)
  391. for _, v in pairs(game.Players:GetChildren()) do
  392. if v.Name == mouse.Target.Parent.Name then
  393. v.Character.Humanoid:TakeDamage(mainDamage/2)
  394. end
  395. end
  396. wait(0.5)
  397. shot:remove()
  398. shot2:remove()
  399. local pos1 = handleaf.Position
  400. local pos2 = mouse.hit.p
  401. local pos3 = handlebf.Position
  402. local pos4 = mouse.hit.p
  403. local shot = Instance.new("Part")
  404. shot.Parent = workspace
  405. shot.Anchored = true
  406. shot.formFactor = "Custom"
  407. shot.BrickColor = BrickColor.new("Bright yellow")
  408. shot.Size = Vector3.new(1, 1, 1)
  409. shot.CanCollide = false
  410. shot.CFrame = CFrame.new((pos1 + pos2) / 2, pos2)
  411. local shot2 = Instance.new("Part")
  412. shot2.Parent = workspace
  413. shot2.Anchored = true
  414. shot2.formFactor = "Custom"
  415. shot2.BrickColor = BrickColor.new("Bright yellow")
  416. shot2.Size = Vector3.new(1, 1, 1)
  417. shot2.CanCollide = false
  418. shot2.CFrame = CFrame.new((pos3 + pos4) / 2, pos4)
  419. local mesh = Instance.new("BlockMesh")
  420. mesh.Parent = shot
  421. mesh.Scale = Vector3.new(0.1, 0.1, (pos1 - pos2).magnitude)
  422. local mesh2 = Instance.new("BlockMesh")
  423. mesh2.Parent = shot2
  424. mesh2.Scale = Vector3.new(0.1, 0.1, (pos3 - pos4).magnitude)
  425. for _, v in pairs(game.Players:GetChildren()) do
  426. if v.Name == mouse.Target.Parent.Name then
  427. v.Character.Humanoid:TakeDamage(mainDamage/2)
  428. end
  429. end
  430. wait(0.5)
  431. shot:remove()
  432. shot2:remove()
  433. local pos1 = handleaf.Position
  434. local pos2 = mouse.hit.p
  435. local pos3 = handlebf.Position
  436. local pos4 = mouse.hit.p
  437. local shot = Instance.new("Part")
  438. shot.Parent = workspace
  439. shot.Anchored = true
  440. shot.formFactor = "Custom"
  441. shot.BrickColor = BrickColor.new("Bright yellow")
  442. shot.Size = Vector3.new(1, 1, 1)
  443. shot.CanCollide = false
  444. shot.CFrame = CFrame.new((pos1 + pos2) / 2, pos2)
  445. local shot2 = Instance.new("Part")
  446. shot2.Parent = workspace
  447. shot2.Anchored = true
  448. shot2.formFactor = "Custom"
  449. shot2.BrickColor = BrickColor.new("Bright yellow")
  450. shot2.Size = Vector3.new(1, 1, 1)
  451. shot2.CanCollide = false
  452. shot2.CFrame = CFrame.new((pos3 + pos4) / 2, pos4)
  453. local mesh = Instance.new("BlockMesh")
  454. mesh.Parent = shot
  455. mesh.Scale = Vector3.new(0.1, 0.1, (pos1 - pos2).magnitude)
  456. local mesh2 = Instance.new("BlockMesh")
  457. mesh2.Parent = shot2
  458. mesh2.Scale = Vector3.new(0.1, 0.1, (pos3 - pos4).magnitude)
  459. for _, v in pairs(game.Players:GetChildren()) do
  460. if v.Name == mouse.Target.Parent.Name then
  461. v.Character.Humanoid:TakeDamage(mainDamage/2)
  462. end
  463. end
  464. for i = 0, 1, 0.1 do
  465. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-0*i), math.rad(75-75*i), 0)
  466. LAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-0*i), math.rad(-75+75*i), 0)
  467. wait()
  468. end
  469. wait(0.25)
  470. shot:remove()
  471. shot2:remove()
  472. ammo = ammo - 10
  473. Attkin = false
  474. end
  475.     end
  476.         if key == "e" then
  477. if ammo > 0 and Attkin == false then
  478. if anim == false then
  479. ammo = ammo - 1
  480. Attkin = true
  481. local pos1 = handlebf.Position
  482. local pos2 = mouse.hit.p
  483. local shot = Instance.new("Part")
  484. shot.Parent = workspace
  485. shot.Anchored = true
  486. shot.formFactor = "Custom"
  487. shot.BrickColor = BrickColor.new("Bright red")
  488. shot.Size = Vector3.new(1, 1, 1)
  489. shot.CanCollide = false
  490. shot.CFrame = CFrame.new((pos1 + pos2) / 2, pos2)
  491. local mesh = Instance.new("BlockMesh")
  492. mesh.Parent = shot
  493. mesh.Scale = Vector3.new(0.1, 0.1, (pos1 - pos2).magnitude)
  494. for _, v in pairs(game.Players:GetChildren()) do
  495. if v.Name == mouse.Target.Parent.Name then
  496. v.Character.Humanoid:TakeDamage(mainDamage)
  497. end
  498. end
  499. local ff = Instance.new("ForceField", char)
  500. local ex = Instance.new("Explosion", workspace)
  501. ex.Position = pos2
  502. wait(0.5)
  503. shot:remove()
  504. ff:remove()
  505. click = 0
  506. Attkin = false
  507. end
  508. end
  509.     end
  510.     end)
  511. end
  512.  
  513. function onDesel(mouse)
  514. for i = 0, 1, 0.1 do
  515. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-90*i), 0, 0)
  516. LAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90-90*i), 0, 0)
  517. wait()
  518. end
  519. LAW.Part1 = nil
  520. RAW.Part1 = nil
  521. handaw.Part1 = Torso
  522. handbw.Part1 = Torso
  523. handaw.C1 = CFrame.new(1.1, -1.5, 0) * CFrame.Angles(0, 0, 0)
  524. handbw.C1 = CFrame.new(-1.1, -1.5, 0) * CFrame.Angles(0, 0, 0)
  525. end
  526.  
  527. bin.Selected:connect(onSelected)
  528. bin.Deselected:connect(onDesel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement