Advertisement
soubrhomi

Nub

Nov 14th, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.47 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Model0 = Instance.new("Model")
  20. Tool1 = Instance.new("Tool")
  21. UnionOperation2 = Instance.new("UnionOperation")
  22. Sound3 = Instance.new("Sound")
  23. Sound4 = Instance.new("Sound")
  24. Sound5 = Instance.new("Sound")
  25. Sound6 = Instance.new("Sound")
  26. PointLight7 = Instance.new("PointLight")
  27. Smoke8 = Instance.new("Smoke")
  28. Sound9 = Instance.new("Sound")
  29. Sound10 = Instance.new("Sound")
  30. Animation11 = Instance.new("Animation")
  31. LocalScript12 = Instance.new("LocalScript")
  32. Script13 = Instance.new("Script")
  33. Part14 = Instance.new("Part")
  34. BillboardGui15 = Instance.new("BillboardGui")
  35. ImageLabel16 = Instance.new("ImageLabel")
  36. Script17 = Instance.new("Script")
  37. Animation18 = Instance.new("Animation")
  38. Script19 = Instance.new("Script")
  39. Camera20 = Instance.new("Camera")
  40. ScreenGui21 = Instance.new("ScreenGui")
  41. Frame22 = Instance.new("Frame")
  42. TextLabel23 = Instance.new("TextLabel")
  43. TextLabel24 = Instance.new("TextLabel")
  44. TextLabel25 = Instance.new("TextLabel")
  45. ImageLabel26 = Instance.new("ImageLabel")
  46. Frame27 = Instance.new("Frame")
  47. Frame28 = Instance.new("Frame")
  48. Frame29 = Instance.new("Frame")
  49. Frame30 = Instance.new("Frame")
  50. ImageLabel31 = Instance.new("ImageLabel")
  51. TextLabel32 = Instance.new("TextLabel")
  52. Frame33 = Instance.new("Frame")
  53. Sound34 = Instance.new("Sound")
  54. Model0.Parent = mas
  55. Tool1.Name = "Handgun"
  56. Tool1.Parent = Model0
  57. Tool1.TextureId = "http://www.roblox.com/asset/?id=122080118"
  58. Tool1.CanBeDropped = false
  59. Tool1.Grip = CFrame.new(0, -0.349999994, -0.100000016, -0.998458922, 0.0554731078, 0.00161359028, 0.0554737262, 0.998460174, 0.000344417145, -0.0015919999, 0.000433398294, -0.999998569)
  60. Tool1.GripForward = Vector3.new(-0.00161359028, -0.000344417145, 0.999998569)
  61. Tool1.GripPos = Vector3.new(0, -0.349999994, -0.100000016)
  62. Tool1.GripRight = Vector3.new(-0.998458922, 0.0554737262, -0.0015919999)
  63. Tool1.GripUp = Vector3.new(0.0554731078, 0.998460174, 0.000433398294)
  64. Tool1.ToolTip = "Handgun"
  65. UnionOperation2.Name = "Handle"
  66. UnionOperation2.Parent = Tool1
  67. UnionOperation2.CFrame = CFrame.new(-4.87051725, 0.607330322, -38.0968056, -1.00000072, 1.05220526e-08, -5.9604659e-08, -1.05220526e-08, 1.00000024, 8.11945622e-09, -5.9604659e-08, -8.11945622e-09, -1.00000072)
  68. UnionOperation2.Orientation = Vector3.new(0, -180, 0)
  69. UnionOperation2.Position = Vector3.new(-4.87051725, 0.607330322, -38.0968056)
  70. UnionOperation2.Rotation = Vector3.new(-180, 0, -180)
  71. UnionOperation2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  72. UnionOperation2.Size = Vector3.new(0.218962356, 1.11467886, 1.54634953)
  73. UnionOperation2.BrickColor = BrickColor.new("Really black")
  74. UnionOperation2.Material = Enum.Material.SmoothPlastic
  75. UnionOperation2.Reflectance = 0.10000000149012
  76. UnionOperation2.brickColor = BrickColor.new("Really black")
  77. Sound3.Name = "EquipSound"
  78. Sound3.Parent = UnionOperation2
  79. Sound3.SoundId = "http://www.roblox.com/asset/?id=171140306"
  80. Sound3.Volume = 0.20000000298023
  81. Sound4.Name = "FireSound"
  82. Sound4.Parent = UnionOperation2
  83. Sound4.SoundId = "rbxassetid://143286342"
  84. Sound4.Volume = 1
  85. Sound5.Name = "Reload"
  86. Sound5.Parent = UnionOperation2
  87. Sound5.Pitch = 0.89999997615814
  88. Sound5.PlaybackSpeed = 0.89999997615814
  89. Sound5.SoundId = "http://www.roblox.com/asset/?id=174295321"
  90. Sound5.Volume = 1
  91. Sound6.Name = "Tick"
  92. Sound6.Parent = UnionOperation2
  93. Sound6.SoundId = "rbxassetid://154255000"
  94. Sound6.Volume = 1
  95. PointLight7.Name = "Flash"
  96. PointLight7.Parent = UnionOperation2
  97. PointLight7.Color = Color3.new(1, 0.568627, 0.192157)
  98. PointLight7.Enabled = false
  99. PointLight7.Shadows = true
  100. Smoke8.Parent = UnionOperation2
  101. Smoke8.Color = Color3.new(0.392157, 0.392157, 0.392157)
  102. Smoke8.Enabled = false
  103. Smoke8.Size = 0.10000000149012
  104. Smoke8.Opacity = 0.10000000149012
  105. Smoke8.RiseVelocity = 4
  106. Sound9.Name = "EquipSound2"
  107. Sound9.Parent = UnionOperation2
  108. Sound9.SoundId = "http://www.roblox.com/asset/?id=169310310"
  109. Sound9.Volume = 0.60000002384186
  110. Sound10.Name = "UnequipSound"
  111. Sound10.Parent = UnionOperation2
  112. Sound10.Pitch = 1.5
  113. Sound10.PlaybackSpeed = 1.5
  114. Sound10.SoundId = "http://www.roblox.com/asset/?id=169310310"
  115. Sound10.Volume = 0.30000001192093
  116. Animation11.Name = "Recoil"
  117. Animation11.Parent = Tool1
  118. Animation11.AnimationId = "http://www.roblox.com/Asset?ID=177443776"
  119. LocalScript12.Name = "HandgunScript"
  120. LocalScript12.Parent = Tool1
  121. table.insert(cors,sandbox(LocalScript12,function()
  122. --------------------- TEMPLATE WEAPON ---------------------------
  123. --edited by DestinyHarbinger
  124. -- Waits for the child of the specified parent
  125. local function WaitForChild(parent, childName)
  126. while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  127. return parent[childName]
  128. end
  129.  
  130. ----- TOOL DATA -----
  131. -- How much damage a bullet does
  132. local Damage = 18
  133. -- How many times per second the gun can fire
  134. local FireRate = 1 / 5.5
  135. -- The maximum distance the can can shoot, this value should never go above 1000
  136. local Range = 350
  137. -- In radians the minimum accuracy penalty
  138. local MinSpread = 0.005
  139. -- In radian the maximum accuracy penalty
  140. local MaxSpread = 0.07
  141. -- Number of bullets in a clip
  142. local ClipSize = 7
  143. -- DefaultValue for spare ammo
  144. local SpareAmmo = 999
  145. -- The amount the aim will increase or decrease by
  146. -- decreases this number reduces the speed that recoil takes effect
  147. local AimInaccuracyStepAmount = .5
  148. -- Time it takes to reload weapon
  149. local ReloadTime = 2.1
  150. ----------------------------------------
  151.  
  152. -- Colors
  153. local FriendlyReticleColor = Color3.new(0, 1, 0)
  154. local EnemyReticleColor = Color3.new(1, 0, 0)
  155. local NeutralReticleColor = Color3.new(1, 1, 1)
  156.  
  157. local Spread = MinSpread
  158. local AmmoInClip = ClipSize
  159.  
  160. local Tool = script.Parent
  161. local Handle = WaitForChild(Tool, 'Handle')
  162. local WeaponGui = nil
  163.  
  164. local LeftButtonDown
  165. local Reloading = false
  166. local IsShooting = false
  167. local Pitch = script.Parent.Handle.FireSound
  168.  
  169. -- Player specific convenience variables
  170. local MyPlayer = nil
  171. local MyCharacter = nil
  172. local MyHumanoid = nil
  173. local MyTorso = nil
  174. local MyMouse = nil
  175.  
  176.  
  177. local RecoilAnim
  178. local RecoilTrack = nil
  179.  
  180. local ReloadAnim
  181. local ReloadTrack = nil
  182.  
  183. local IconURL = Tool.TextureId
  184. local DebrisService = game:GetService('Debris')
  185. local PlayersService = game:GetService('Players')
  186.  
  187.  
  188. local FireSound
  189.  
  190. local OnFireConnection = nil
  191. local OnReloadConnection = nil
  192.  
  193. local DecreasedAimLastShot = false
  194. local LastSpreadUpdate = time()
  195.  
  196. local flare = script.Parent:WaitForChild("Flare")
  197.  
  198. -- this is a dummy object that holds the flash made when the gun is fired
  199. local FlashHolder = nil
  200.  
  201.  
  202. local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
  203. local GetCellFunction = Workspace.Terrain.GetCell
  204.  
  205. function RayIgnoreCheck(hit, pos)
  206. if hit then
  207. if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
  208. hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
  209. hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
  210. return true
  211. elseif hit:IsA('Terrain') and pos then
  212. local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
  213. if cellPos then
  214. local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
  215. if cellMat and cellMat == Enum.CellMaterial.Water then
  216. return true
  217. end
  218. end
  219. end
  220. end
  221. return false
  222. end
  223.  
  224. -- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
  225. function RayCast(startPos, vec, rayLength)
  226. local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
  227. if hitObject and hitPos then
  228. local distance = rayLength - (hitPos - startPos).magnitude
  229. if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
  230. -- there is a chance here for potential infinite recursion
  231. return RayCast(hitPos, vec, distance)
  232. end
  233. end
  234. return hitObject, hitPos
  235. end
  236.  
  237.  
  238.  
  239. function TagHumanoid(humanoid, player)
  240. -- Add more tags here to customize what tags are available.
  241. while humanoid:FindFirstChild('creator') do
  242. humanoid:FindFirstChild('creator'):Destroy()
  243. end
  244. local creatorTag = Instance.new("ObjectValue")
  245. creatorTag.Value = player
  246. creatorTag.Name = "creator"
  247. creatorTag.Parent = humanoid
  248. DebrisService:AddItem(creatorTag, 1.5)
  249.  
  250. local weaponIconTag = Instance.new("StringValue")
  251. weaponIconTag.Value = IconURL
  252. weaponIconTag.Name = "icon"
  253. weaponIconTag.Parent = creatorTag
  254. end
  255.  
  256.  
  257. local function CreateBullet(bulletPos)
  258. local bullet = Instance.new('Part', Workspace)
  259. bullet.FormFactor = Enum.FormFactor.Custom
  260. bullet.Size = Vector3.new(0.1, 0.1, 0.1)
  261. bullet.BrickColor = BrickColor.new("Black")
  262. bullet.Shape = Enum.PartType.Block
  263. bullet.CanCollide = false
  264. bullet.CFrame = CFrame.new(bulletPos)
  265. bullet.Anchored = true
  266. bullet.TopSurface = Enum.SurfaceType.Smooth
  267. bullet.BottomSurface = Enum.SurfaceType.Smooth
  268. bullet.Name = 'Bullet'
  269. DebrisService:AddItem(bullet, 2.5)
  270.  
  271. local shell = Instance.new("Part")
  272. shell.CFrame = Tool.Handle.CFrame * CFrame.fromEulerAnglesXYZ(1.5,0,0)
  273. shell.Size = Vector3.new(1,1,1)
  274. shell.BrickColor = BrickColor.new(226)
  275. shell.Parent = game.Workspace
  276. shell.CFrame = script.Parent.Handle.CFrame
  277. shell.CanCollide = false
  278. shell.Transparency = 0
  279. shell.BottomSurface = 0
  280. shell.TopSurface = 0
  281. shell.Name = "Shell"
  282. shell.Velocity = Tool.Handle.CFrame.lookVector * 35 + Vector3.new(math.random(-10,10),20,math.random(-10,20))
  283. shell.RotVelocity = Vector3.new(0,200,0)
  284. DebrisService:AddItem(shell, 1)
  285.  
  286. local shellmesh = Instance.new("SpecialMesh")
  287. shellmesh.Scale = Vector3.new(.15,.4,.15)
  288. shellmesh.Parent = shell
  289.  
  290. return bullet
  291. end
  292.  
  293. local function Reload()
  294. if not Reloading then
  295. Reloading = true
  296. -- Don't reload if you are already full or have no extra ammo
  297. if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
  298. if RecoilTrack then
  299. RecoilTrack:Stop()
  300. end
  301. if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
  302. if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
  303. WeaponGui.Crosshair.ReloadingLabel.Visible = true
  304. end
  305. end
  306. if ReloadTrack then
  307. ReloadTrack:Play()
  308. end
  309. script.Parent.Handle.Reload:Play()
  310. wait(ReloadTime)
  311. -- Only use as much ammo as you have
  312. local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
  313. AmmoInClip = AmmoInClip + ammoToUse
  314. SpareAmmo = SpareAmmo - ammoToUse
  315. UpdateAmmo(AmmoInClip)
  316. --WeaponGui.Reload.Visible = false
  317. if ReloadTrack then
  318. ReloadTrack:Stop()
  319. end
  320. end
  321. Reloading = false
  322. end
  323. end
  324.  
  325. function OnFire()
  326. if IsShooting then return end
  327. if MyHumanoid and MyHumanoid.Health > 0 then
  328. if RecoilTrack and AmmoInClip > 0 then
  329. RecoilTrack:Play()
  330. end
  331. IsShooting = true
  332. while LeftButtonDown and AmmoInClip > 0 and not Reloading do
  333. if Spread and not DecreasedAimLastShot then
  334. Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
  335. UpdateCrosshair(Spread)
  336. end
  337. DecreasedAimLastShot = not DecreasedAimLastShot
  338. if Handle:FindFirstChild('FireSound') then
  339. Pitch.Pitch = .8 + (math.random() * .5)
  340. Handle.FireSound:Play()
  341. Handle.Flash.Enabled = true
  342. flare.MuzzleFlash.Enabled = true
  343. --Handle.Smoke.Enabled=true --This is optional
  344. end
  345. if MyMouse then
  346. local targetPoint = MyMouse.Hit.p
  347. local shootDirection = (targetPoint - Handle.Position).unit
  348. -- Adjust the shoot direction randomly off by a little bit to account for recoil
  349. shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
  350. (0.5 - math.random()) * 2 * Spread,
  351. (0.5 - math.random()) * 2 * Spread) * shootDirection
  352. local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
  353. local bullet
  354. -- Create a bullet here
  355. if hitObject then
  356. bullet = CreateBullet(bulletPos)
  357. end
  358. if hitObject and hitObject.Parent then
  359. local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
  360. if hitHumanoid then
  361. local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
  362. if MyPlayer.Neutral or (hitPlayer and hitPlayer.TeamColor ~= MyPlayer.TeamColor) then
  363. TagHumanoid(hitHumanoid, MyPlayer)
  364. hitHumanoid:TakeDamage(Damage)
  365. if bullet then
  366. bullet:Destroy()
  367. bullet = nil
  368. WeaponGui.Crosshair.Hit:Play()
  369. --bullet.Transparency = 1
  370. end
  371. Spawn(UpdateTargetHit)
  372. end
  373. end
  374. end
  375. AmmoInClip = AmmoInClip - 1
  376. UpdateAmmo(AmmoInClip)
  377. end
  378. wait(FireRate)
  379. end
  380. Handle.Flash.Enabled = false
  381. IsShooting = false
  382. flare.MuzzleFlash.Enabled = false
  383. --Handle.Smoke.Enabled=false --This is optional
  384. if AmmoInClip == 0 then
  385. Handle.Tick:Play()
  386. --WeaponGui.Reload.Visible = true
  387. Reload()
  388. end
  389. if RecoilTrack then
  390. RecoilTrack:Stop()
  391. end
  392. end
  393. end
  394.  
  395. local TargetHits = 0
  396. function UpdateTargetHit()
  397. TargetHits = TargetHits + 1
  398. if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
  399. WeaponGui.Crosshair.TargetHitImage.Visible = true
  400. end
  401. wait(0.5)
  402. TargetHits = TargetHits - 1
  403. if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
  404. WeaponGui.Crosshair.TargetHitImage.Visible = false
  405. end
  406. end
  407.  
  408. function UpdateCrosshair(value, mouse)
  409. if WeaponGui then
  410. local absoluteY = 650
  411. WeaponGui.Crosshair:TweenSize(
  412. UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
  413. Enum.EasingDirection.Out,
  414. Enum.EasingStyle.Linear,
  415. 0.33)
  416. end
  417. end
  418.  
  419. function UpdateAmmo(value)
  420. if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
  421. WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
  422. if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
  423. WeaponGui.Crosshair.ReloadingLabel.Visible = false
  424. end
  425. end
  426. if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
  427. WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
  428. end
  429. end
  430.  
  431.  
  432. function OnMouseDown()
  433. LeftButtonDown = true
  434. OnFire()
  435. end
  436.  
  437. function OnMouseUp()
  438. LeftButtonDown = false
  439. end
  440.  
  441. function OnKeyDown(key)
  442. if string.lower(key) == 'r' then
  443. Reload()
  444. if RecoilTrack then
  445. RecoilTrack:Stop()
  446. end
  447. end
  448. end
  449.  
  450.  
  451. function OnEquipped(mouse)
  452. Handle.EquipSound:Play()
  453. Handle.EquipSound2:Play()
  454. Handle.UnequipSound:Stop()
  455. RecoilAnim = WaitForChild(Tool, 'Recoil')
  456. ReloadAnim = WaitForChild(Tool, 'Reload')
  457. FireSound = WaitForChild(Handle, 'FireSound')
  458.  
  459. MyCharacter = Tool.Parent
  460. MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
  461. MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
  462. MyTorso = MyCharacter:FindFirstChild('Torso')
  463. MyMouse = mouse
  464. WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
  465. if WeaponGui and MyPlayer then
  466. WeaponGui.Parent = MyPlayer.PlayerGui
  467. UpdateAmmo(AmmoInClip)
  468. end
  469. if RecoilAnim then
  470. RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
  471. end
  472.  
  473. if ReloadAnim then
  474. ReloadTrack = MyHumanoid:LoadAnimation(ReloadAnim)
  475. end
  476.  
  477. if MyMouse then
  478. -- Disable mouse icon
  479. MyMouse.Icon = "http://www.roblox.com/asset/?id=18662154"
  480. MyMouse.Button1Down:connect(OnMouseDown)
  481. MyMouse.Button1Up:connect(OnMouseUp)
  482. MyMouse.KeyDown:connect(OnKeyDown)
  483. end
  484. end
  485.  
  486.  
  487. -- Unequip logic here
  488. function OnUnequipped()
  489. Handle.UnequipSound:Play()
  490. Handle.EquipSound:Stop()
  491. Handle.EquipSound2:Stop()
  492. LeftButtonDown = false
  493. flare.MuzzleFlash.Enabled = false
  494. Reloading = false
  495. MyCharacter = nil
  496. MyHumanoid = nil
  497. MyTorso = nil
  498. MyPlayer = nil
  499. MyMouse = nil
  500. if OnFireConnection then
  501. OnFireConnection:disconnect()
  502. end
  503. if OnReloadConnection then
  504. OnReloadConnection:disconnect()
  505. end
  506. if FlashHolder then
  507. FlashHolder = nil
  508. end
  509. if WeaponGui then
  510. WeaponGui.Parent = nil
  511. WeaponGui = nil
  512. end
  513. if RecoilTrack then
  514. RecoilTrack:Stop()
  515. end
  516. if ReloadTrack then
  517. ReloadTrack:Stop()
  518. end
  519. end
  520.  
  521. local function SetReticleColor(color)
  522. if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
  523. for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
  524. if line:IsA('Frame') then
  525. line.BorderColor3 = color
  526. end
  527. end
  528. end
  529. end
  530.  
  531.  
  532. Tool.Equipped:connect(OnEquipped)
  533. Tool.Unequipped:connect(OnUnequipped)
  534.  
  535. while true do
  536. wait(0.033)
  537. if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
  538. WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
  539. SetReticleColor(NeutralReticleColor)
  540.  
  541. local target = MyMouse.Target
  542. if target and target.Parent then
  543. local player = PlayersService:GetPlayerFromCharacter(target.Parent)
  544. if player then
  545. if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
  546. SetReticleColor(EnemyReticleColor)
  547. else
  548. SetReticleColor(FriendlyReticleColor)
  549. end
  550. end
  551. end
  552. end
  553. if Spread and not IsShooting then
  554. local currTime = time()
  555. if currTime - LastSpreadUpdate > FireRate * 2 then
  556. LastSpreadUpdate = currTime
  557. Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
  558. UpdateCrosshair(Spread, MyMouse)
  559. end
  560. end
  561. end
  562.  
  563. end))
  564. Script13.Name = "WeldingDoNotDelete"
  565. Script13.Parent = Tool1
  566. table.insert(cors,sandbox(Script13,function()
  567. --DO NOT DELETE, THIS WILL BREAK THE GUN
  568.  
  569. function Stick(x, y)
  570. local W = Instance.new("Weld")
  571. W.Part0 = x
  572. W.Part1 = y
  573. local CJ = CFrame.new(x.Position)
  574. local C0 = x.CFrame:inverse()*CJ
  575. local C1 = y.CFrame:inverse()*CJ
  576. W.C0 = C0
  577. W.C1 = C1
  578. W.Parent = x
  579. end
  580.  
  581. function Get(A)
  582. if A.ClassName == ("Part") then
  583. Stick(script.Parent.Handle, A)
  584. A.Anchored = false
  585. else
  586. local C = A:GetChildren()
  587. for i=1, #C do
  588. Get(C[i])
  589. end
  590. end
  591. end
  592.  
  593. function Finale()
  594. Get(script.Parent)
  595. end
  596.  
  597. script.Parent.Equipped:connect(Finale)
  598. script.Parent.Unequipped:connect(Finale)
  599. Finale()
  600. end))
  601. Part14.Name = "Flare"
  602. Part14.Parent = Tool1
  603. Part14.CFrame = CFrame.new(-4.87999678, 0.979990602, -39.1899796, 1.00000036, -2.40926101e-09, -1.1920929e-07, 1.29313085e-08, 1.00000012, -8.11945711e-09, 1.78813934e-07, 1.11022302e-15, 1.00000036)
  604. Part14.Position = Vector3.new(-4.87999678, 0.979990602, -39.1899796)
  605. Part14.Transparency = 1
  606. Part14.Size = Vector3.new(1, 1, 1)
  607. Part14.CanCollide = false
  608. Part14.FormFactor = Enum.FormFactor.Symmetric
  609. Part14.formFactor = Enum.FormFactor.Symmetric
  610. BillboardGui15.Name = "MuzzleFlash"
  611. BillboardGui15.Parent = Part14
  612. BillboardGui15.Enabled = false
  613. BillboardGui15.Size = UDim2.new(2, 0, 2, 0)
  614. ImageLabel16.Name = "Img"
  615. ImageLabel16.Parent = BillboardGui15
  616. ImageLabel16.Size = UDim2.new(1, 0, 1, 0)
  617. ImageLabel16.BackgroundTransparency = 1
  618. ImageLabel16.Image = "http://www.roblox.com/asset/?ID=103740493"
  619. Script17.Parent = ImageLabel16
  620. table.insert(cors,sandbox(Script17,function()
  621. local imgs = {103740493,103804266,103804383}
  622. for _,v in pairs(imgs) do
  623. game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?ID="..v)
  624. end
  625.  
  626. script.Parent.Parent.Changed:connect(function ()
  627. if script.Parent.Parent.Enabled == true then
  628. wait(0.09)
  629. script.Parent.Parent.Enabled = false
  630. end
  631. end)
  632.  
  633. while true do
  634. for i = 1,#imgs do
  635. script.Parent.Image = "http://www.roblox.com/asset/?ID="..imgs[i]
  636. wait(0.03)
  637. end
  638. end
  639.  
  640. end))
  641. Animation18.Name = "Reload"
  642. Animation18.Parent = Tool1
  643. Animation18.AnimationId = "http://www.roblox.com/Asset?ID=95384819"
  644. Script19.Name = "Readme From Destiny"
  645. Script19.Parent = Tool1
  646. table.insert(cors,sandbox(Script19,function()
  647. --[[HANDGUN v1.2 CREATED BY DESTINYHARBINGER
  648.  
  649. A fully working, non virus riddled, and decently realistic up to date handgun made from a Unioned Part
  650. made from solid modeling. This weapon is actually an edited Template Assualt Rifle you can see from those
  651. broken template games. Modified to become more modern and up to date.
  652.  
  653. This weapon features:
  654. -Anti Teamkill
  655. -Flashes and Flares and Bears Oh My!
  656. -Reloading (WOWWWWWWW)
  657. -IOS and Android Compatibility (Tested and Approved)
  658. -No virus junk.
  659. -Animations (will improve later)
  660. -Easy to edit script!
  661. -Decent pistol sounds!
  662. -Non-laggy! Only 2 parts and thats it!
  663. -and not so much more because its just a regular gun!!!!!!!
  664.  
  665. )))))))))IMPORTANT:
  666. DO NOT DELETE, UNUNION, OR CHANGE NAMES OF ANYTHING UNLESS YOU ARE AN EXPERT AT DOING THAT BUISNESS.
  667. TREAD CAREFULLY.
  668.  
  669.  
  670. ~PATCH NOTES~
  671. v1.2
  672. -Tool not working if in starterpack has been fixed by Luckymaxer.
  673. -Minor HUD changes.
  674.  
  675.  
  676. v1.1
  677. -Smoke is now disabled. Go through the handgun script and CTRL + F, search smoke, and uncomment the options
  678. for it to work again.
  679. -Shell casings have been added
  680. -When sucessfully hitting someone, a local sound is played to indicate a hit.
  681. -Works with mobile now. Thats right, you can now use it on iPhone Sean.
  682. -Changed Equipping sounds.
  683.  
  684. ______ _____ _____ _____ _____ _ _ __ __
  685. | _ \| ___|/ ___||_ _||_ _|| \ | |\ \ / /
  686. | | | || |__ \ `--. | | | | | \| | \ V /
  687. | | | || __| `--. \ | | | | | . ` | \ /
  688. | |/ / | |___ /\__/ / | | _| |_ | |\ | | |
  689. |___/ \____/ \____/ \_/ \___/ \_| \_/ \_/
  690.  
  691.  
  692. _ _ ___ ______ ______ _____ _ _ _____ _____ ______
  693. | | | | / _ \ | ___ \| ___ \|_ _|| \ | || __ \| ___|| ___ \
  694. | |_| |/ /_\ \| |_/ /| |_/ / | | | \| || | \/| |__ | |_/ /
  695. | _ || _ || / | ___ \ | | | . ` || | __ | __| | /
  696. | | | || | | || |\ \ | |_/ / _| |_ | |\ || |_\ \| |___ | |\ \
  697. \_| |_/\_| |_/\_| \_|\____/ \___/ \_| \_/ \____/\____/ \_| \_|
  698. __ __ _____ _____ _____ ______ _____ _____ __ _____
  699. / / \ \ / __ \| _ || _ ||___ / / __ \| _ |/ | | ___|
  700. | | ___ | | `' / /'| |/' || |/' | / /______`' / /'| |/' |`| | |___ \
  701. | | / __|| | / / | /| || /| | / /|______| / / | /| | | | \ \
  702. | || (__ | | ./ /___\ |_/ /\ |_/ /./ / ./ /___\ |_/ /_| |_/\__/ /
  703. | | \___|| | \_____/ \___/ \___/ \_/ \_____/ \___/ \___/\____/
  704. \_\ /_/
  705.  
  706. If you can, leave me some credit k ;)
  707.  
  708. ]]
  709. end))
  710. Camera20.Name = "ThumbnailCamera"
  711. Camera20.Parent = Tool1
  712. Camera20.CFrame = CFrame.new(-7.073627, 1.91333532, -40.2050323, -0.684124351, 0.268417299, -0.678178549, 1.49011612e-08, 0.929820061, 0.368014812, 0.729365468, 0.251767904, -0.636112452)
  713. Camera20.CoordinateFrame = CFrame.new(-7.073627, 1.91333532, -40.2050323, -0.684124351, 0.268417299, -0.678178549, 1.49011612e-08, 0.929820061, 0.368014812, 0.729365468, 0.251767904, -0.636112452)
  714. Camera20.FieldOfView = 25.000000418326
  715. Camera20.Focus = CFrame.new(-5.71727037, 1.17730594, -38.9328079, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  716. Camera20.focus = CFrame.new(-5.71727037, 1.17730594, -38.9328079, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  717. ScreenGui21.Name = "WeaponHud"
  718. ScreenGui21.Parent = Tool1
  719. Frame22.Name = "AmmoHud"
  720. Frame22.Parent = ScreenGui21
  721. Frame22.Position = UDim2.new(1, -265, 1, -60)
  722. Frame22.Size = UDim2.new(0, 200, 0, 50)
  723. Frame22.BackgroundTransparency = 1
  724. Frame22.BorderSizePixel = 0
  725. TextLabel23.Name = "ForwardSlash"
  726. TextLabel23.Parent = Frame22
  727. TextLabel23.Position = UDim2.new(0.5, 0, 0.5, 0)
  728. TextLabel23.BackgroundTransparency = 1
  729. TextLabel23.BorderSizePixel = 0
  730. TextLabel23.Font = Enum.Font.SourceSans
  731. TextLabel23.FontSize = Enum.FontSize.Size24
  732. TextLabel23.Text = "/"
  733. TextLabel23.TextColor = BrickColor.new("Institutional white")
  734. TextLabel23.TextColor3 = Color3.new(1, 1, 1)
  735. TextLabel23.TextScaled = true
  736. TextLabel23.TextSize = 24
  737. TextLabel23.TextStrokeTransparency = 0
  738. TextLabel23.TextWrap = true
  739. TextLabel23.TextWrapped = true
  740. TextLabel24.Name = "ClipAmmo"
  741. TextLabel24.Parent = Frame22
  742. TextLabel24.Position = UDim2.new(0.449999988, 0, 0.5, 0)
  743. TextLabel24.BackgroundTransparency = 1
  744. TextLabel24.BorderSizePixel = 0
  745. TextLabel24.Font = Enum.Font.SourceSansBold
  746. TextLabel24.FontSize = Enum.FontSize.Size24
  747. TextLabel24.Text = "54"
  748. TextLabel24.TextColor = BrickColor.new("Institutional white")
  749. TextLabel24.TextColor3 = Color3.new(1, 1, 1)
  750. TextLabel24.TextScaled = true
  751. TextLabel24.TextSize = 24
  752. TextLabel24.TextStrokeTransparency = 0
  753. TextLabel24.TextWrap = true
  754. TextLabel24.TextWrapped = true
  755. TextLabel24.TextXAlignment = Enum.TextXAlignment.Right
  756. TextLabel25.Name = "TotalAmmo"
  757. TextLabel25.Parent = Frame22
  758. TextLabel25.Position = UDim2.new(0.550000012, 0, 0.5, 0)
  759. TextLabel25.BackgroundTransparency = 1
  760. TextLabel25.BorderSizePixel = 0
  761. TextLabel25.Font = Enum.Font.SourceSans
  762. TextLabel25.FontSize = Enum.FontSize.Size24
  763. TextLabel25.Text = "180"
  764. TextLabel25.TextColor = BrickColor.new("Institutional white")
  765. TextLabel25.TextColor3 = Color3.new(1, 1, 1)
  766. TextLabel25.TextScaled = true
  767. TextLabel25.TextSize = 24
  768. TextLabel25.TextStrokeTransparency = 0
  769. TextLabel25.TextWrap = true
  770. TextLabel25.TextWrapped = true
  771. TextLabel25.TextXAlignment = Enum.TextXAlignment.Left
  772. ImageLabel26.Parent = Frame22
  773. ImageLabel26.Size = UDim2.new(0, 200, 0, 50)
  774. ImageLabel26.BackgroundColor = BrickColor.new("Institutional white")
  775. ImageLabel26.BackgroundColor3 = Color3.new(1, 1, 1)
  776. ImageLabel26.BackgroundTransparency = 1
  777. ImageLabel26.BorderColor = BrickColor.new("Really black")
  778. ImageLabel26.BorderColor3 = Color3.new(0, 0, 0)
  779. ImageLabel26.BorderSizePixel = 0
  780. ImageLabel26.Image = "rbxassetid://51219827"
  781. ImageLabel26.ImageColor3 = Color3.new(0.352941, 0.352941, 0.352941)
  782. ImageLabel26.ImageTransparency = 0.20000000298023
  783. Frame27.Name = "Crosshair"
  784. Frame27.Parent = ScreenGui21
  785. Frame27.Position = UDim2.new(0, 500, 0, 500)
  786. Frame27.Size = UDim2.new(0, 150, 0, 150)
  787. Frame27.BackgroundColor = BrickColor.new("Lime green")
  788. Frame27.BackgroundColor3 = Color3.new(0, 1, 0)
  789. Frame27.BackgroundTransparency = 1
  790. Frame27.BorderSizePixel = 0
  791. Frame28.Name = "TopFrame"
  792. Frame28.Parent = Frame27
  793. Frame28.Position = UDim2.new(0, -1, -0.5, -7)
  794. Frame28.Size = UDim2.new(0, 2, 0, 14)
  795. Frame28.BackgroundColor = BrickColor.new("Really black")
  796. Frame28.BackgroundColor3 = Color3.new(0, 0, 0)
  797. Frame28.BorderColor = BrickColor.new("Institutional white")
  798. Frame28.BorderColor3 = Color3.new(1, 1, 1)
  799. Frame29.Name = "RightFrame"
  800. Frame29.Parent = Frame27
  801. Frame29.Position = UDim2.new(0.5, -7, 0, -1)
  802. Frame29.Size = UDim2.new(0, 14, 0, 2)
  803. Frame29.BackgroundColor = BrickColor.new("Really black")
  804. Frame29.BackgroundColor3 = Color3.new(0, 0, 0)
  805. Frame29.BorderColor = BrickColor.new("Institutional white")
  806. Frame29.BorderColor3 = Color3.new(1, 1, 1)
  807. Frame30.Name = "LeftFrame"
  808. Frame30.Parent = Frame27
  809. Frame30.Position = UDim2.new(-0.5, -7, 0, -1)
  810. Frame30.Size = UDim2.new(0, 14, 0, 2)
  811. Frame30.BackgroundColor = BrickColor.new("Really black")
  812. Frame30.BackgroundColor3 = Color3.new(0, 0, 0)
  813. Frame30.BorderColor = BrickColor.new("Institutional white")
  814. Frame30.BorderColor3 = Color3.new(1, 1, 1)
  815. ImageLabel31.Name = "TargetHitImage"
  816. ImageLabel31.Parent = Frame27
  817. ImageLabel31.Position = UDim2.new(0, -25, 0, -25)
  818. ImageLabel31.Visible = false
  819. ImageLabel31.Size = UDim2.new(0, 50, 0, 50)
  820. ImageLabel31.BackgroundTransparency = 1
  821. ImageLabel31.BorderSizePixel = 0
  822. ImageLabel31.Image = "http://www.roblox.com/asset/?id=115400215"
  823. TextLabel32.Name = "ReloadingLabel"
  824. TextLabel32.Parent = Frame27
  825. TextLabel32.Position = UDim2.new(0, 20, 0, -20)
  826. TextLabel32.Visible = false
  827. TextLabel32.BackgroundTransparency = 1
  828. TextLabel32.BorderSizePixel = 0
  829. TextLabel32.Font = Enum.Font.ArialBold
  830. TextLabel32.FontSize = Enum.FontSize.Size18
  831. TextLabel32.Text = "Reloading"
  832. TextLabel32.TextColor = BrickColor.new("Crimson")
  833. TextLabel32.TextColor3 = Color3.new(0.568627, 0, 0)
  834. TextLabel32.TextSize = 18
  835. TextLabel32.TextStrokeTransparency = 0
  836. TextLabel32.TextXAlignment = Enum.TextXAlignment.Left
  837. TextLabel32.TextYAlignment = Enum.TextYAlignment.Bottom
  838. Frame33.Name = "BottomFrame"
  839. Frame33.Parent = Frame27
  840. Frame33.Position = UDim2.new(0, -1, 0.5, -7)
  841. Frame33.Size = UDim2.new(0, 2, 0, 14)
  842. Frame33.BackgroundColor = BrickColor.new("Really black")
  843. Frame33.BackgroundColor3 = Color3.new(0, 0, 0)
  844. Frame33.BorderColor = BrickColor.new("Institutional white")
  845. Frame33.BorderColor3 = Color3.new(1, 1, 1)
  846. Sound34.Name = "Hit"
  847. Sound34.Parent = Frame27
  848. Sound34.SoundId = "rbxassetid://160432334"
  849. Sound34.Volume = 1
  850. for i,v in pairs(mas:GetChildren()) do
  851. v.Parent = script
  852. pcall(function() v:MakeJoints() end)
  853. end
  854. mas:Destroy()
  855. for i,v in pairs(cors) do
  856. spawn(function()
  857. pcall(v)
  858. end)
  859. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement