BINO2002

Untitled

Feb 19th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.54 KB | None | 0 0
  1. Plrs = game:GetService("Players")
  2. me = Plrs.LocalPlayer
  3. char = me.Character
  4. Modelname = "TagGun"
  5. Toolname = "Gun"
  6. Able = true
  7. Selected = false
  8. Crouching = false
  9. Charging = false
  10. Throwing = false
  11. ShootAnim = false
  12. Smashing = false
  13. SmashDmg = 60
  14. MaxGrenades = 6
  15. Grenades = MaxGrenades
  16. GrenadeDist = 18
  17. GrenadePower = (GrenadeDist*100)/3
  18. GrenadeTime = 3.8
  19. ReflectMax = 7
  20. ReflectMin = 3
  21.  
  22. MaxCharge = 200
  23. Charge = MaxCharge
  24. ChargeCost = 25
  25. GiveCharge = MaxCharge/8
  26.  
  27. Dmg = 55
  28. Accuracy = 2
  29. Debounce = 1.4
  30.  
  31. MouseIc = "http://www.roblox.com/asset/?id=50054737"
  32. MouseRe = "http://www.roblox.com/asset/?id=50055025"
  33. MousePi = "http://www.roblox.com/asset/?id=50055031"
  34.  
  35. function Notime(func, tim)
  36. coroutine.resume(coroutine.create(function()
  37. if tim then
  38. wait(tim)
  39. end
  40. func()
  41. end))
  42. end
  43.  
  44. function waitChild(parent, name)
  45. local child = parent:findFirstChild(name)
  46. if child then return child end
  47. while true do
  48. child = parent.ChildAdded:wait()
  49. if child.Name == name then return child end
  50. end
  51. end
  52.  
  53.  
  54. Add = {
  55. Sphere = function(P)
  56. local m = Instance.new("SpecialMesh",P)
  57. m.MeshType = "Sphere"
  58. return m
  59. end,
  60. BF = function(P)
  61. local bf = Instance.new("BodyForce",P)
  62. bf.force = Vector3.new(0, P:GetMass()*187, 0)
  63. return bf
  64. end,
  65. BP = function(P)
  66. local bp = Instance.new("BodyPosition",P)
  67. bp.maxForce = Vector3.new(math.huge, 0, math.huge)
  68. bp.P = 14000
  69. return bp
  70. end,
  71. BG = function(P)
  72. local bg = Instance.new("BodyGyro",P)
  73. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  74. bg.P = 14000
  75. return bg
  76. end,
  77. Mesh = function(P, ID, x, y, z)
  78. local m = Instance.new("SpecialMesh")
  79. m.MeshId = ID
  80. m.Scale = Vector3.new(x, y, z)
  81. m.Parent = P
  82. return m
  83. end,
  84. Sound = function(P, ID, vol, pitch)
  85. local s = Instance.new("Sound")
  86. s.SoundId = ID
  87. s.Volume = vol
  88. s.Pitch = pitch
  89. s.Parent = P
  90. return s
  91. end
  92. }
  93.  
  94. function ComputePos(pos1, pos2)
  95. local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  96. return CFrame.new(pos1, pos3)
  97. end
  98.  
  99. function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break)
  100. local p = Instance.new("Part")
  101. p.formFactor = "Custom"
  102. p.Anchored = Anchor
  103. p.CanCollide = Collide
  104. p.Transparency = Tran
  105. p.Reflectance = Ref
  106. p.BrickColor = BrickColor.new(Color)
  107. p.TopSurface = 0
  108. p.BottomSurface = 0
  109. p.Size = Vector3.new(X, Y, Z)
  110. if Break then
  111. p:BreakJoints()
  112. else p:MakeJoints() end
  113. p.Parent = Parent
  114. return p
  115. end
  116.  
  117. function Weld(p0, p1, x, y, z, a, b, c)
  118. local w = Instance.new("Weld")
  119. w.Parent = p0
  120. w.Part0 = p0
  121. w.Part1 = p1
  122. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c)
  123. return w
  124. end
  125.  
  126. function getHumanoid(c)
  127. local h = nil
  128. for i,v in pairs(c:children()) do
  129. if v:IsA("Humanoid") and c ~= char then
  130. if v.Health > 0 then
  131. h = v
  132. end
  133. end
  134. end
  135. return h
  136. end
  137.  
  138. function getCharacters(where, pos, dist)
  139. local chars = {}
  140. for _, v in pairs(where:children()) do
  141. local hum = getHumanoid(v)
  142. local tors = v:findFirstChild("Torso")
  143. if tors ~= nil and hum ~= nil then
  144. local anypart = nil
  145. for _,k in pairs(v:children()) do
  146. if k:IsA("BasePart") then
  147. if (k.Position - pos).magnitude <= dist then
  148. anypart = k
  149. break
  150. end
  151. end
  152. end
  153. if anypart then
  154. table.insert(chars, {v, tors, hum})
  155. end
  156. end
  157. end
  158. return chars
  159. end
  160.  
  161. Gawnz = Instance.new("Model",workspace.Base)
  162. Gawnz.Name = "Gawnz"
  163.  
  164. function RC(Pos, Dir, Max, Ignore)
  165. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999)), Ignore)
  166. end
  167.  
  168. function Draw(Pos1, Pos2)
  169. local mag = (Pos1 - Pos2).magnitude
  170. local line = Part(Gawnz, true, false, 0, 0, tostring(me.TeamColor), 0.2, 0.2, 1, true)
  171. line.CFrame = CFrame.new(Pos1, Pos2) * CFrame.new(0, 0, -mag/2)
  172. local mesh = Instance.new("SpecialMesh",line)
  173. mesh.MeshType = "Brick"
  174. mesh.Scale = Vector3.new(1, 1, mag)
  175. Notime(function()
  176. for i = 0, 1, 0.33 do
  177. wait()
  178. line.Transparency = i
  179. end
  180. line:remove()
  181. end)
  182. end
  183.  
  184. Lazors = {
  185. {"http://www.roblox.com/asset/?id=22968437", 2.6},
  186. {"http://www.roblox.com/asset?id=1369158", 4.4},
  187. {"http://www.roblox.com/asset/?id=13775480", 1.4}
  188. }
  189. Mirroring = {
  190. {"http://www.roblox.com/asset/?id=12222124", 7.5},
  191. }
  192.  
  193. function PlaySound(id, pitch, vol)
  194. local s = Add.Sound(nil, id, vol, pitch)
  195. if pitch ~= nil then
  196. if tonumber(pitch) then
  197. s.Pitch = tonumber(pitch)
  198. end
  199. end
  200. if vol ~= nil then
  201. if tonumber(vol) then
  202. s.Volume = tonumber(vol)
  203. end
  204. end
  205. s.Parent = torso
  206. s.PlayOnRemove = true
  207. Notime(function()
  208. wait()
  209. s:remove()
  210. end)
  211. end
  212.  
  213. function Playz(tab, vol, pitch1)
  214. local pick = tab[math.random(1, #tab)]
  215. local id, pitch = pick[1], pick[2]
  216. PlaySound(id, math.random(pitch-pitch1, pitch+pitch1), vol)
  217. end
  218.  
  219. function EndEffect(pos)
  220. local p = Part(Gawnz, true, false, 0.1, 0, me.TeamColor.Name, 1, 1, 1, true)
  221. p.CFrame = CFrame.new(pos)
  222. local sp = Add.Sphere(p)
  223. Notime(function()
  224. for i = 0, 1, 0.1 do
  225. sp.Scale = Vector3.new(0.4+1.2*i, 0.4+1.2*i, 0.4+1.2*i)
  226. p.Transparency = 0.1+0.9*i
  227. wait()
  228. end
  229. p:remove()
  230. end)
  231. end
  232.  
  233. torso = waitChild(char, "Torso")
  234. head = waitChild(char, "Head")
  235. neck = waitChild(torso, "Neck")
  236. hum = waitChild(char, "Humanoid")
  237. Rarm = waitChild(char, "Right Arm")
  238. Larm = waitChild(char, "Left Arm")
  239. Rleg = waitChild(char, "Right Leg")
  240. Lleg = waitChild(char, "Left Leg")
  241.  
  242.  
  243. RH = waitChild(torso, "Right Hip")
  244. LH = waitChild(torso, "Left Hip")
  245. RH.Part0 = torso
  246. LH.Part0 = torso
  247.  
  248. for i,v in pairs(char:children()) do
  249. if v.Name == Modelname or v:IsA("Hat") or v:IsA("Pants") or v:IsA("Shirt") or v:IsA("CharacterMesh") then
  250. v:remove()
  251. end
  252. end
  253.  
  254. PlrGui = waitChild(me, "PlayerGui")
  255. Sc = Instance.new("ScreenGui")
  256. Sc.Name = "LaserTagOptions"
  257.  
  258. Main = Instance.new("Frame", Sc)
  259. Main.Size = UDim2.new(0, 150, 0, 350)
  260. Main.Position = UDim2.new(1, -150-10, 0.5, -350/2)
  261. Main.BackgroundColor3 = Color3.new(0.2, 0.1, 0.3)
  262. Main.BackgroundTransparency = 0.2
  263.  
  264. ChargeBack = Instance.new("Frame", Main)
  265. ChargeBack.Size = UDim2.new(0, 40, 1, -40)
  266. ChargeBack.Position = UDim2.new(0, 10, 0, 10)
  267. ChargeBack.BorderSizePixel = 0
  268. ChargeBack.BackgroundColor3 = Color3.new(0, 0, 0)
  269. ChargeBack.BackgroundTransparency = 0.3
  270.  
  271. GrenadeBack = ChargeBack:clone()
  272. GrenadeBack.Parent = Main
  273. GrenadeBack.Position = UDim2.new(1, -40-10, 0, 30)
  274.  
  275. ChargeText = Instance.new("TextLabel", ChargeBack)
  276. ChargeText.Font = "ArialBold"
  277. ChargeText.FontSize = "Size18"
  278. ChargeText.TextXAlignment = "Left"
  279. ChargeText.TextYAlignment = "Top"
  280. ChargeText.Position = UDim2.new(0, 0, 1, 2)
  281. ChargeText.TextColor3 = Color3.new(1,1,1)
  282. ChargeText.BackgroundTransparency = 1
  283. ChargeText.Text = "Charge"
  284.  
  285. ChargeBar = Instance.new("ImageLabel", ChargeBack)
  286. ChargeBar.Size = UDim2.new(1, -4, Charge/MaxCharge, -4)
  287. ChargeBar.Position = UDim2.new(0, 2, 0, 2)
  288. ChargeBar.BackgroundColor = BrickColor.new(me.TeamColor.Name)
  289. ChargeBar.Image = "http://www.roblox.com/asset/?id=50051953"
  290. ChargeBar.BackgroundTransparency = 0.25
  291.  
  292. GrenadeBar = Instance.new("ImageLabel", GrenadeBack)
  293. GrenadeBar.Size = UDim2.new(1, -4, Grenades/MaxGrenades, -4)
  294. GrenadeBar.Position = UDim2.new(0, 2, 0, 2)
  295. GrenadeBar.BackgroundColor3 = Color3.new(1, 0.75, 0)
  296. GrenadeBar.Image = "http://www.roblox.com/asset/?id=50051953"
  297. GrenadeBar.BackgroundTransparency = 0.25
  298.  
  299. CBT = Instance.new("TextLabel", ChargeBack)
  300. CBT.TextColor3 = Color3.new(0.85, 0.85, 0.85)
  301. CBT.BackgroundTransparency = 1
  302. CBT.Font = "ArialBold"
  303. CBT.FontSize = "Size14"
  304. CBT.Text = math.ceil((Charge/MaxCharge)*100).."%"
  305. CBT.Position = UDim2.new(0.5, 0, 0.5, 0)
  306.  
  307. GBT = CBT:clone()
  308. GBT.TextColor3 = Color3.new(1, 1, 1)
  309. GBT.FontSize = "Size18"
  310. GBT.Text = Grenades
  311. GBT.Parent = GrenadeBack
  312.  
  313. GrenadeText = ChargeText:clone()
  314. GrenadeText.Parent = GrenadeBack
  315. GrenadeText.Text = "Grenades"
  316. GrenadeText.TextYAlignment = "Bottom"
  317. GrenadeText.TextXAlignment = "Right"
  318. GrenadeText.Position = UDim2.new(1, 0, 0, -2)
  319.  
  320. Fillscreen = Instance.new("TextLabel", Sc)
  321. Fillscreen.Visible = false
  322. Fillscreen.Size = UDim2.new(1, 0, 1, 1)
  323. Fillscreen.Position = UDim2.new(0, 0, 0, -1)
  324. Fillscreen.BackgroundColor3 = Color3.new()
  325. Fillscreen.TextColor3 = Color3.new(1, 1, 1)
  326. Fillscreen.Font = "ArialBold"
  327. Fillscreen.Text = "Zoom ALL WAY IN to play!"
  328. Fillscreen.FontSize = "Size48"
  329.  
  330. Sc.Parent = PlrGui
  331. cam = workspace.CurrentCamera
  332.  
  333. Mo = Instance.new("Model")
  334. Mo.Name = Modelname
  335.  
  336. Faketorso = Part(Mo, false, false, 0, 0, tostring(torso.BrickColor), 2, 2, 1, true)
  337. Faketorso.Name = "FakeTorso"
  338.  
  339. FakeArms = Instance.new("Model")
  340.  
  341. local PR1 = Part(FakeArms, false, false, 0, 0, tostring(me.TeamColor), 0.2, 0.2, 0.2)
  342. Instance.new("SpecialMesh",PR1).Scale = Vector3.new(3.5, 8, 3.5)
  343. Weld(Rarm, PR1, -0.3, -0.4, 0, math.rad(10), 0, math.rad(-20))
  344.  
  345. local PR2 = Part(FakeArms, false, false, 0, 0, tostring(Rarm.BrickColor), 0.2, 0.2, 0.2)
  346. Instance.new("SpecialMesh",PR2).Scale = Vector3.new(3.5, 6, 3.5)
  347. Weld(Rarm, PR2, -0.3, 0.4, 0, math.rad(-10), 0, math.rad(20))
  348.  
  349. local PL1 = Part(FakeArms, false, false, 0, 0, tostring(me.TeamColor), 0.2, 0.2, 0.2)
  350. Instance.new("SpecialMesh",PL1).Scale = Vector3.new(3.5, 8, 3.5)
  351. Weld(Larm, PL1, 0.3, -0.4, 0, math.rad(10), 0, math.rad(20))
  352.  
  353. local PL2 = Part(FakeArms, false, false, 0, 0, tostring(Larm.BrickColor), 0.2, 0.2, 0.2)
  354. Instance.new("SpecialMesh",PL2).Scale = Vector3.new(3.5, 6, 3.5)
  355. Weld(Larm, PL2, 0.3, 0.4, 0, math.rad(-10), 0, math.rad(-20))
  356.  
  357. FakeArms.Parent = cam
  358.  
  359. local TW = Weld(torso, Faketorso, 0, 0, 0, 0, 0, 0)
  360.  
  361. torso.Transparency = 1
  362.  
  363. RABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  364. LABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  365. RLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  366. LLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  367.  
  368. RABW = Weld(Faketorso, RABrick, -1.5, -0.5, 0, 0, 0, 0)
  369. LABW = Weld(Faketorso, LABrick, 1.5, -0.5, 0, 0, 0, 0)
  370. RLBW = Weld(Faketorso, RLBrick, -0.5, 1.2, 0, 0, 0, 0)
  371. LLBW = Weld(Faketorso, LLBrick, 0.5, 1.2, 0, 0, 0, 0)
  372.  
  373. RAW = Weld(RABrick, nil, 0, 0.5, 0, 0, 0, 0)
  374. LAW = Weld(LABrick, nil, 0, 0.5, 0, 0, 0, 0)
  375. RLW = Weld(RLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  376. LLW = Weld(LLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  377.  
  378. HB = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  379. HBW = Weld(Rarm, HB, 0, 1, 0, 0, 0, 0)
  380. HW = Weld(HB, nil, -0.2, 0.5, 0.5, 0, 0, 0)
  381.  
  382. Handle = Part(Gawnz, false, false, 0, 0, "Black", 0.1, 0.1, 0.1, true)
  383. Handle.Name = "Handle"
  384. Add.Mesh(Handle, "rbxasset://fonts/PaintballGun.mesh", 1, 1, 1)
  385.  
  386. HW.Part1 = Handle
  387.  
  388. Mo.Parent = char
  389.  
  390. RAW.Part1 = Rarm
  391. LAW.Part1 = Larm
  392.  
  393. RH.Part0 = Faketorso
  394. LH.Part0 = Faketorso
  395.  
  396. TW.C0 = CFrame.Angles(0, math.rad(-45), 0)
  397.  
  398. RAWMain = CFrame.Angles(math.rad(90), 0, math.rad(-45)) * CFrame.new(0, -0.7, -0.02)
  399. LAWMain = CFrame.Angles(math.rad(90), 0, math.rad(40)) * CFrame.new(0, -0.6, -0.01)
  400.  
  401. RAW.C0 = RAWMain
  402. LAW.C0 = LAWMain
  403.  
  404. function FireAnim()
  405. ShootAnim = true
  406. local Place = RAW.C0
  407. local Place2 = HW.C0
  408. for i = 0, 1, 0.5 do
  409. RAW.C0 = Place * CFrame.new(0, 0.35*i, 0)
  410. HW.C0 = Place2 * CFrame.new(0, 0, 0.25*i)
  411. wait()
  412. end
  413. for i = 1, 0, -0.33 do
  414. RAW.C0 = Place * CFrame.new(0, 0.35*i, 0)
  415. HW.C0 = Place2 * CFrame.new(0, 0, 0.25*i)
  416. wait()
  417. end
  418. HW.C0 = Place2
  419. RAW.C0 = Place
  420. ShootAnim = false
  421. end
  422.  
  423. function Fire(fro, t, max, bounce)
  424. local from = fro
  425. local to = t
  426. local a2, b2, c2 = math.random(-Accuracy*10, Accuracy*10)/10, math.random(-Accuracy*10, Accuracy*10)/10, math.random(-Accuracy*10, Accuracy*10)/10
  427. if Crouching then
  428. a2, b2, b3 = math.random(-Accuracy*10, Accuracy*10)/70, math.random(-Accuracy*10, Accuracy*10)/70, math.random(-Accuracy*10, Accuracy*10)/70
  429. end
  430. local cf = (CFrame.new(from, to) * CFrame.Angles(math.rad(a2), math.rad(a2), math.rad(a2)) * CFrame.new(0, 0, -4)).p
  431. local Hit, pos = RC(from, (cf - from), max, Gawnz)
  432. Draw(from, pos)
  433. EndEffect(pos)
  434. if Hit then
  435. if Hit.Parent:IsA("Hat") then
  436. Hit:breakJoints()
  437. end
  438. end
  439. local function dmg(p, dm)
  440. local h = nil
  441. if p then
  442. h = getHumanoid(p.Parent)
  443. if h then
  444. local realdmg = dm
  445. if p.Name == "Head" then
  446. realdmg = dm*2
  447. end
  448. h.Health = h.Health - realdmg
  449. end
  450. end
  451. return h
  452. end
  453. local h = nil
  454. if bounce then
  455. Notime(FireAnim)
  456. h = dmg(Hit, Dmg)
  457. Playz(Lazors, math.random(40,75)/100, 0.3)
  458. end
  459. Notime(function()
  460. if bounce and h == nil and Hit ~= nil then
  461. local mag = (from - to).magnitude
  462. local left = (max*1.5)-mag
  463. for _ = 1, math.random(ReflectMin,ReflectMax) do
  464. Playz(Mirroring, math.random(40,75)/100, 0.9)
  465. wait(mag/550)
  466. local a, b, c = math.random(-40, 40), math.random(-15, 15), math.random(-40, 40)
  467. to = (CFrame.new(pos, from) * CFrame.Angles(math.rad(a), math.rad(b), math.rad(c)) * CFrame.new(0, 0, -4)).p
  468. from = pos
  469. Hit, pos = Fire(from, to, max, false)
  470. mag = (from - to).magnitude
  471. left = left-mag
  472. local ha = dmg(Hit, Dmg)
  473. if left <= 0 or Hit == nil or ha ~= nil then break end
  474. end
  475. end
  476. end)
  477. return Hit, pos
  478. end
  479.  
  480. if script.Parent.className ~= "Tool" then
  481. Tool = Instance.new("Tool", me.Backpack)
  482. Tool.Name = "Gun"
  483. script.Parent = Tool
  484. end
  485.  
  486. bin = script.Parent
  487.  
  488. CrouchR = RAWMain * CFrame.new(-0.5, -0.35, 0)
  489. CrouchL = LAWMain * CFrame.new(0, 0.3, 0)
  490.  
  491. function Crouch()
  492. if Crouching == false then
  493. Crouching = true
  494. RH.Part1 = nil
  495. LH.Part1 = nil
  496. RLW.Part1 = Rleg
  497. LLW.Part1 = Lleg
  498. Rleg.CanCollide = true
  499. Lleg.CanCollide = true
  500. Rleg.Name = "Rcrouch"
  501. Lleg.Name = "Lcrouch"
  502. for i = 0, 1, 0.2 do
  503. RLW.C0 = CFrame.Angles(math.rad(5*i), 0, 0) * CFrame.new(0, 1.4*i, -1*i)
  504. LLW.C0 = CFrame.Angles(math.rad(-90*i), 0, 0) * CFrame.new(0, 0.3*i, 0.15*i)
  505. RAW.C0 = RAWMain * CFrame.new(-0.5*i, -0.35*i, 0)
  506. LAW.C0 = LAWMain * CFrame.new(0, 0.3*i, 0)
  507. wait()
  508. end
  509. else
  510. Crouching = false
  511. Rleg.Name = "Right Leg"
  512. Lleg.Name = "Left Leg"
  513. for i = 1, 0, -0.2 do
  514. RLW.C0 = CFrame.Angles(math.rad(10*i), 0, 0) * CFrame.new(0, 1.4*i, -1*i)
  515. LLW.C0 = CFrame.Angles(math.rad(-90*i), 0, 0) * CFrame.new(0, 0.3*i, 0.15*i)
  516. RAW.C0 = RAWMain * CFrame.new(-0.5*i, -0.35*i, 0)
  517. LAW.C0 = LAWMain * CFrame.new(0, 0.3*i, 0)
  518. wait()
  519. end
  520. RH.Part1 = Rleg
  521. LH.Part1 = Lleg
  522. RLW.Part1 = nil
  523. LLW.Part1 = nil
  524. Rleg.CanCollide = false
  525. Lleg.CanCollide = false
  526. end
  527. end
  528.  
  529. function MakeGrenade()
  530. local grenade = Part(workspace, false, false, 0, 0, me.TeamColor.Name, 0.8, 1, 0.8, true)
  531. grenade.Friction = 0.8
  532. Add.Mesh(grenade, "http://www.roblox.com/Asset/?id=10207236", 0.15, 0.12, 0.15)
  533. local w = Weld(Larm, grenade, 0, 0, -1.25, 0, 0, 0)
  534. w.C0 = CFrame.Angles(math.pi/2, 0, 0)
  535. return grenade, w
  536. end
  537.  
  538. function Throw(Mousepos)
  539. if Throwing == false and Grenades > 0 then
  540. Grenades = Grenades - 1
  541. Throwing = true
  542. for i = 0, 1, 0.25 do
  543. LAW.C0 = LAWMain * CFrame.Angles(math.rad(-85*i), 0, math.rad(30*i)) * CFrame.new(0, 0.2*i, 0.4*i)
  544. wait()
  545. end
  546. for i = 0, 1, 0.5 do
  547. LAW.C0 = LAWMain * CFrame.Angles(math.rad(-85), 0, math.rad(30)) * CFrame.new(0, 0.2-0.3*i, 0.4-0.5*i)
  548. wait()
  549. end
  550. local Gr, We = MakeGrenade()
  551. for i = 0, 1, 0.1 do
  552. LAW.C0 = LAWMain * CFrame.Angles(math.rad(-85+195*i), 0, math.rad(30-70*i)) * CFrame.new(0, -0.1+0.1*i, -0.1+0.1*i)
  553. wait()
  554. end
  555. We:remove()
  556. wait()
  557. local Mag = (torso.Position - Mousepos).magnitude
  558. Mag = Mag - (Mag/8)
  559. if Mag > 35 then Mag = 35 end
  560. local Power = (30+(Mag*1.5))
  561. Gr.Velocity = (CFrame.new(torso.Position, Mousepos) * CFrame.Angles(math.rad(20), 0, 0)).lookVector * Power
  562. Gr.CanCollide = true
  563. Notime(function()
  564. wait(GrenadeTime)
  565. local d = GrenadeDist
  566. local pos = Gr.Position
  567. local cf = CFrame.new(pos) * CFrame.Angles(math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)))
  568. Gr:remove()
  569. local eff = Instance.new("Model", workspace)
  570. eff.Name = "GrenadeEffect"
  571. local ball = Part(eff, true, false, 0, 0, me.TeamColor.Name, 1, 1, 1, true)
  572. ball.CFrame = cf
  573. local sp = Add.Sphere(ball)
  574. local ring = Part(eff, true, false, 0, 0, me.TeamColor.Name, 1, 1, 1, true)
  575. ring.CFrame = cf
  576. local rng = Add.Mesh(ring, "http://www.roblox.com/asset/?id=3270017", (d/2), (d/2), (d/2))
  577. local ring2 = Part(eff, true, false, 0, 0, me.TeamColor.Name, 1, 1, 1, true)
  578. ring2.CFrame = cf
  579. local rng2 = Add.Mesh(ring2, "http://www.roblox.com/asset/?id=3270017", (d/2), (d/2), (d/2))
  580. local ring3 = Part(eff, true, false, 0, 0, me.TeamColor.Name, 1, 1, 1, true)
  581. ring3.CFrame = cf
  582. local rng3 = Add.Mesh(ring3, "http://www.roblox.com/asset/?id=3270017", (d/2), (d/2), (d/2))
  583. Notime(function()
  584. PlaySound("http://www.roblox.com/asset/?id=2101148", 1.25, 0.6)
  585. for i = 0, 1, 0.065 do
  586. ball.Transparency = i
  587. sp.Scale = Vector3.new((d*2)*i, (d*2)*i, (d*2)*i)
  588. ring.Transparency = i
  589. ring2.Transparency = i
  590. ring3.Transparency = i
  591. rng.Scale = Vector3.new((d/2)+(d*2)*i, (d/2)+(d*2)*i, (d/2)+(d*2.8)*i)
  592. rng2.Scale = Vector3.new((d/2)+(d*2)*i, (d/2)+(d*2)*i, (d/2)+(d*2.8)*i)
  593. rng3.Scale = Vector3.new((d/2)+(d*2)*i, (d/2)+(d*2)*i, (d/2)+(d*2.8)*i)
  594. ring.CFrame = cf * CFrame.Angles(math.rad(180*i), 0, 0)
  595. ring2.CFrame = cf * CFrame.Angles(0, math.rad(180*i), 0)
  596. ring3.CFrame = cf * CFrame.Angles(0, math.rad(90*i), math.rad(180*i))
  597. wait()
  598. end
  599. eff:remove()
  600. end)
  601. local chars = getCharacters(workspace, pos, GrenadeDist)
  602. for _, v in pairs(chars) do
  603. local dist = (pos - v[2].Position).magnitude
  604. if dist < 1 then dist = 1 end
  605. local power = GrenadePower/dist
  606. v[3].Health = v[3].Health - power
  607. v[2].Velocity = CFrame.new(pos, v[2].Position).lookVector * 30
  608. end
  609. end)
  610. for i = 0, 1, 0.25 do
  611. LAW.C0 = LAWMain * CFrame.Angles(math.rad(110), 0, math.rad(-75-80*i)) * CFrame.new(0, -0.4*i, 0)
  612. wait()
  613. end
  614. for i = 0, 1, 0.33 do
  615. LAW.C0 = LAWMain * CFrame.Angles(math.rad(110-110), 0, math.rad(-155+155*i)) * CFrame.new(0, -0.4+0.4*i, 0)
  616. wait()
  617. end
  618. Throwing = false
  619. LAW.C0 = LAWMain
  620. end
  621. end
  622.  
  623. function Reload()
  624. if Charging == false and Throwing == false and Charge < MaxCharge then
  625. Charging = true
  626. for i = 0, 1, 0.05 do
  627. RAW.C0 = CFrame.Angles(math.rad(90-35*i), 0, math.rad(-45+25*i)) * CFrame.new(-0.5*i, -0.7+0.9*i, -0.02)
  628. LAW.C0 = CFrame.Angles(math.rad(90-35*i), 0, math.rad(40+5*i)) * CFrame.new(0, -0.6-0.4*i, -0.01)
  629. wait()
  630. end
  631. repeat
  632. for i = 0, 1, 0.15 do
  633. RAW.C0 = CFrame.Angles(math.rad(90-35), 0, math.rad(-45+25)) * CFrame.new(-0.5, -0.7+0.9, -0.02)
  634. LAW.C0 = CFrame.Angles(math.rad(90-35+10*i), 0, math.rad(45-10*i)) * CFrame.new(0, -0.6-0.4-0.2*i, -0.01)
  635. wait()
  636. end
  637. PlaySound("rbxasset://sounds\\clickfast.wav", 2, 0.6)
  638. for i = 0, 1, 0.15 do
  639. RAW.C0 = CFrame.Angles(math.rad(90-35), 0, math.rad(-45+25)) * CFrame.new(-0.5, -0.7+0.9, -0.02)
  640. LAW.C0 = CFrame.Angles(math.rad(90-35+10-10*i), 0, math.rad(45-10+10*i)) * CFrame.new(0, -0.6-0.4-0.2+0.2*i, -0.01)
  641. wait()
  642. end
  643. PlaySound("rbxasset://sounds\\clickfast.wav", 2, 0.6)
  644. Charge = Charge + GiveCharge
  645. wait(0.08)
  646. until Charge >= MaxCharge-1
  647. for i = 0, 1, 0.1 do
  648. RAW.C0 = CFrame.Angles(math.rad(90-35+35*i), 0, math.rad(-45+25-25*i)) * CFrame.new(-0.5+0.5*i, -0.7+0.9-0.9*i, -0.02)
  649. LAW.C0 = CFrame.Angles(math.rad(90-35+35*i), 0, math.rad(40+5-5*i)) * CFrame.new(0, -0.6-0.4+0.4*i, -0.01)
  650. wait()
  651. end
  652. RAW.C0 = RAWMain
  653. LAW.C0 = LAWMain
  654. Charging = false
  655. end
  656. end
  657.  
  658. function SmashGet()
  659. local chars = getCharacters(workspace, Handle.Position, 2)
  660. if chars[1] ~= nil then
  661. local teammate = false
  662. local p = Plrs:GetPlayerFromCharacter(chars[1][1])
  663. if p then
  664. if p.TeamColor == me.TeamColor then
  665. teammate = true
  666. end
  667. end
  668. chars[1][3].Health = chars[1][3].Health - SmashDmg
  669. end
  670. end
  671.  
  672.  
  673. function Smash()
  674. Smashing = true
  675. PlaySound("rbxasset://sounds//swordslash.wav", 0.8, 0.75)
  676. for i = 0, 1, 0.15 do
  677. TW.C0 = CFrame.Angles(0, math.rad(-45+45*i), 0)
  678. RAW.C0 = CFrame.Angles(math.rad(90+90*i), 0, math.rad(-45+45*i)) * CFrame.new(0, -0.7+0.7*i, -0.02)
  679. LAW.C0 = CFrame.Angles(math.rad(90-45*i), 0, math.rad(40)) * CFrame.new(0, -0.6+0.3*i, -0.01)
  680. wait()
  681. end
  682. for i = 0, 1, 0.33 do
  683. TW.C0 = CFrame.Angles(0, math.rad(25*i), 0) --45*i
  684. RAW.C0 = CFrame.Angles(math.rad(180-80*i), 0, math.rad(5*i)) * CFrame.new(0, -0.2*i, -0.02)
  685. LAW.C0 = CFrame.Angles(math.rad(45-45*i), 0, math.rad(40-25*i)) * CFrame.new(0, -0.6+0.3+0.15*i, -0.01)
  686. wait()
  687. end
  688. SmashGet()
  689. for i = 0.5, 1, 0.5 do
  690. TW.C0 = CFrame.Angles(0, math.rad(25+20*i), 0)
  691. RAW.C0 = CFrame.Angles(math.rad(180-80-60*i), 0, math.rad(5+5*i)) * CFrame.new(0, -0.2, -0.02)
  692. LAW.C0 = CFrame.Angles(math.rad(45-45-35*i), 0, math.rad(40-25-15*i)) * CFrame.new(0, -0.6+0.3+0.15+0.15*i, -0.01)
  693. wait()
  694. end
  695. for i = 0, 1, 0.1 do
  696. TW.C0 = CFrame.Angles(0, math.rad(45-90*i), 0)
  697. RAW.C0 = CFrame.Angles(math.rad(40+50*i), 0, math.rad(10-55*i)) * CFrame.new(0, -0.35-0.35*i, -0.02)
  698. LAW.C0 = CFrame.Angles(math.rad(-35+125*i), 0, math.rad(40*i)) * CFrame.new(0, -0.6*i, -0.01)
  699. wait()
  700. end
  701. RAW.C0 = RAWMain
  702. LAW.C0 = LAWMain
  703. TW.C0 = CFrame.Angles(0, math.rad(-45), 0)
  704. Smashing = false
  705. end
  706.  
  707. bin.Equipped:connect(function(mouse)
  708. Selected = true
  709. bin.Parent = nil
  710. mouse.Button1Down:connect(function()
  711. if Able and hum.Health > 0 and Charge >= ChargeCost and Charging == false and Smashing == false then
  712. Charge = Charge - ChargeCost
  713. Able = false
  714. local from = Handle.CFrame * CFrame.new(0, 2, -0.2).p
  715. local to = mouse.Hit.p
  716. Fire(from, to, 420, true)
  717. wait(Debounce)
  718. Able = true
  719. elseif Charge < ChargeCost and Able and Smashing == false then
  720. Reload()
  721. end
  722. end)
  723. mouse.KeyDown:connect(function(key)
  724. key = key:lower()
  725. if Charging == false and Smashing == false and Able then
  726. if key == "f" then
  727. Throw(mouse.Hit.p)
  728. elseif key == "r" then
  729. Reload()
  730. elseif key == "q" then
  731. Smash()
  732. end
  733. end
  734. if key == "c" and Smashing == false then
  735. Crouch()
  736. end
  737. end)
  738. while hum.Health > 0 do
  739. if Throwing == false and Charging == false and ShootAnim == false and Able then
  740. local mousepos = mouse.Hit.p
  741. local mypos = torso.Position + Vector3.new(0, 0.5, 0)
  742. local magn = (mypos - mousepos).magnitude/75
  743. local offset = (mypos.y - mousepos.y)/65
  744. offset = offset/magn
  745. if offset > 0.75 then offset = 0.75 elseif offset < -1 then offset = -1 end
  746. local oh = 26
  747. local Main1, Main2 = RAWMain, LAWMain
  748. if Crouching and CrouchR then
  749. Main1, Main2 = CrouchR, CrouchL
  750. end
  751. RAW.C0 = Main1 * CFrame.Angles(-math.ceil(offset*22)/oh, 0, 0) * CFrame.new(0, -math.floor(math.abs(offset/4.5)*15)/35, 0)
  752. LAW.C0 = Main2 * CFrame.Angles(-math.ceil(offset*20)/oh, 0, math.floor(math.abs(offset/3.5)*6)/25) * CFrame.new(0, -math.floor(math.abs(offset/3.5)*25)/oh, 0)
  753. end
  754. if Charging then
  755. mouse.Icon = MouseRe
  756. else
  757. mouse.Icon = MouseIc
  758. end
  759. wait()
  760. end
  761. end)
  762.  
  763. bin.Parent = char
  764.  
  765. local bg = Add.BG(nil)
  766.  
  767. while true do
  768. if Crouching then
  769. hum.WalkSpeed = 8
  770. bg.Parent = torso
  771. bg.cframe = ComputePos(cam.CoordinateFrame.p, torso.Position)
  772. else
  773. bg.Parent = nil
  774. hum.WalkSpeed = 16
  775. end
  776. if Charge > MaxCharge then Charge = MaxCharge end
  777. if Grenades > MaxGrenades then Grenades = MaxGrenades end
  778. GrenadeBar.Size = UDim2.new(1, -4, Grenades/MaxGrenades, 0)
  779. GrenadeBar.Position = UDim2.new(0, 2, 0, 0)
  780. ChargeBar.Size = UDim2.new(1, -4, -(Charge/MaxCharge), 0)
  781. ChargeBar.Position = UDim2.new(0, 2, 1, 0)
  782. CBT.Text = math.ceil((Charge/MaxCharge)*100).."%"
  783. GBT.Text = Grenades
  784. local magn = (head.Position - cam.CoordinateFrame.p).magnitude
  785. if magn > 2.4 then
  786. --Fillscreen.Visible = true
  787. else
  788. --Fillscreen.Visible = false
  789. end
  790. wait()
  791. end
Add Comment
Please, Sign In to add comment