Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Tool1 = Instance.new("Tool")
- UnionOperation2 = Instance.new("UnionOperation")
- Sound3 = Instance.new("Sound")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- Sound6 = Instance.new("Sound")
- PointLight7 = Instance.new("PointLight")
- Smoke8 = Instance.new("Smoke")
- Sound9 = Instance.new("Sound")
- Sound10 = Instance.new("Sound")
- Animation11 = Instance.new("Animation")
- LocalScript12 = Instance.new("LocalScript")
- Script13 = Instance.new("Script")
- Part14 = Instance.new("Part")
- BillboardGui15 = Instance.new("BillboardGui")
- ImageLabel16 = Instance.new("ImageLabel")
- Script17 = Instance.new("Script")
- Animation18 = Instance.new("Animation")
- Script19 = Instance.new("Script")
- Camera20 = Instance.new("Camera")
- ScreenGui21 = Instance.new("ScreenGui")
- Frame22 = Instance.new("Frame")
- TextLabel23 = Instance.new("TextLabel")
- TextLabel24 = Instance.new("TextLabel")
- TextLabel25 = Instance.new("TextLabel")
- ImageLabel26 = Instance.new("ImageLabel")
- Frame27 = Instance.new("Frame")
- Frame28 = Instance.new("Frame")
- Frame29 = Instance.new("Frame")
- Frame30 = Instance.new("Frame")
- ImageLabel31 = Instance.new("ImageLabel")
- TextLabel32 = Instance.new("TextLabel")
- Frame33 = Instance.new("Frame")
- Sound34 = Instance.new("Sound")
- Model0.Parent = mas
- Tool1.Name = "Handgun"
- Tool1.Parent = Model0
- Tool1.TextureId = "http://www.roblox.com/asset/?id=122080118"
- Tool1.CanBeDropped = false
- 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)
- Tool1.GripForward = Vector3.new(-0.00161359028, -0.000344417145, 0.999998569)
- Tool1.GripPos = Vector3.new(0, -0.349999994, -0.100000016)
- Tool1.GripRight = Vector3.new(-0.998458922, 0.0554737262, -0.0015919999)
- Tool1.GripUp = Vector3.new(0.0554731078, 0.998460174, 0.000433398294)
- Tool1.ToolTip = "Handgun"
- UnionOperation2.Name = "Handle"
- UnionOperation2.Parent = Tool1
- 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)
- UnionOperation2.Orientation = Vector3.new(0, -180, 0)
- UnionOperation2.Position = Vector3.new(-4.87051725, 0.607330322, -38.0968056)
- UnionOperation2.Rotation = Vector3.new(-180, 0, -180)
- UnionOperation2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation2.Size = Vector3.new(0.218962356, 1.11467886, 1.54634953)
- UnionOperation2.BrickColor = BrickColor.new("Really black")
- UnionOperation2.Material = Enum.Material.SmoothPlastic
- UnionOperation2.Reflectance = 0.10000000149012
- UnionOperation2.brickColor = BrickColor.new("Really black")
- Sound3.Name = "EquipSound"
- Sound3.Parent = UnionOperation2
- Sound3.SoundId = "http://www.roblox.com/asset/?id=171140306"
- Sound3.Volume = 0.20000000298023
- Sound4.Name = "FireSound"
- Sound4.Parent = UnionOperation2
- Sound4.SoundId = "rbxassetid://143286342"
- Sound4.Volume = 1
- Sound5.Name = "Reload"
- Sound5.Parent = UnionOperation2
- Sound5.Pitch = 0.89999997615814
- Sound5.PlaybackSpeed = 0.89999997615814
- Sound5.SoundId = "http://www.roblox.com/asset/?id=174295321"
- Sound5.Volume = 1
- Sound6.Name = "Tick"
- Sound6.Parent = UnionOperation2
- Sound6.SoundId = "rbxassetid://154255000"
- Sound6.Volume = 1
- PointLight7.Name = "Flash"
- PointLight7.Parent = UnionOperation2
- PointLight7.Color = Color3.new(1, 0.568627, 0.192157)
- PointLight7.Enabled = false
- PointLight7.Shadows = true
- Smoke8.Parent = UnionOperation2
- Smoke8.Color = Color3.new(0.392157, 0.392157, 0.392157)
- Smoke8.Enabled = false
- Smoke8.Size = 0.10000000149012
- Smoke8.Opacity = 0.10000000149012
- Smoke8.RiseVelocity = 4
- Sound9.Name = "EquipSound2"
- Sound9.Parent = UnionOperation2
- Sound9.SoundId = "http://www.roblox.com/asset/?id=169310310"
- Sound9.Volume = 0.60000002384186
- Sound10.Name = "UnequipSound"
- Sound10.Parent = UnionOperation2
- Sound10.Pitch = 1.5
- Sound10.PlaybackSpeed = 1.5
- Sound10.SoundId = "http://www.roblox.com/asset/?id=169310310"
- Sound10.Volume = 0.30000001192093
- Animation11.Name = "Recoil"
- Animation11.Parent = Tool1
- Animation11.AnimationId = "http://www.roblox.com/Asset?ID=177443776"
- LocalScript12.Name = "HandgunScript"
- LocalScript12.Parent = Tool1
- table.insert(cors,sandbox(LocalScript12,function()
- --------------------- TEMPLATE WEAPON ---------------------------
- --edited by DestinyHarbinger
- -- Waits for the child of the specified parent
- local function WaitForChild(parent, childName)
- while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
- return parent[childName]
- end
- ----- TOOL DATA -----
- -- How much damage a bullet does
- local Damage = 18
- -- How many times per second the gun can fire
- local FireRate = 1 / 5.5
- -- The maximum distance the can can shoot, this value should never go above 1000
- local Range = 350
- -- In radians the minimum accuracy penalty
- local MinSpread = 0.005
- -- In radian the maximum accuracy penalty
- local MaxSpread = 0.07
- -- Number of bullets in a clip
- local ClipSize = 7
- -- DefaultValue for spare ammo
- local SpareAmmo = 999
- -- The amount the aim will increase or decrease by
- -- decreases this number reduces the speed that recoil takes effect
- local AimInaccuracyStepAmount = .5
- -- Time it takes to reload weapon
- local ReloadTime = 2.1
- ----------------------------------------
- -- Colors
- local FriendlyReticleColor = Color3.new(0, 1, 0)
- local EnemyReticleColor = Color3.new(1, 0, 0)
- local NeutralReticleColor = Color3.new(1, 1, 1)
- local Spread = MinSpread
- local AmmoInClip = ClipSize
- local Tool = script.Parent
- local Handle = WaitForChild(Tool, 'Handle')
- local WeaponGui = nil
- local LeftButtonDown
- local Reloading = false
- local IsShooting = false
- local Pitch = script.Parent.Handle.FireSound
- -- Player specific convenience variables
- local MyPlayer = nil
- local MyCharacter = nil
- local MyHumanoid = nil
- local MyTorso = nil
- local MyMouse = nil
- local RecoilAnim
- local RecoilTrack = nil
- local ReloadAnim
- local ReloadTrack = nil
- local IconURL = Tool.TextureId
- local DebrisService = game:GetService('Debris')
- local PlayersService = game:GetService('Players')
- local FireSound
- local OnFireConnection = nil
- local OnReloadConnection = nil
- local DecreasedAimLastShot = false
- local LastSpreadUpdate = time()
- local flare = script.Parent:WaitForChild("Flare")
- -- this is a dummy object that holds the flash made when the gun is fired
- local FlashHolder = nil
- local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
- local GetCellFunction = Workspace.Terrain.GetCell
- function RayIgnoreCheck(hit, pos)
- if hit then
- if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
- hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
- hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
- return true
- elseif hit:IsA('Terrain') and pos then
- local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
- if cellPos then
- local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
- if cellMat and cellMat == Enum.CellMaterial.Water then
- return true
- end
- end
- end
- end
- return false
- end
- -- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
- function RayCast(startPos, vec, rayLength)
- local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
- if hitObject and hitPos then
- local distance = rayLength - (hitPos - startPos).magnitude
- if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
- -- there is a chance here for potential infinite recursion
- return RayCast(hitPos, vec, distance)
- end
- end
- return hitObject, hitPos
- end
- function TagHumanoid(humanoid, player)
- -- Add more tags here to customize what tags are available.
- while humanoid:FindFirstChild('creator') do
- humanoid:FindFirstChild('creator'):Destroy()
- end
- local creatorTag = Instance.new("ObjectValue")
- creatorTag.Value = player
- creatorTag.Name = "creator"
- creatorTag.Parent = humanoid
- DebrisService:AddItem(creatorTag, 1.5)
- local weaponIconTag = Instance.new("StringValue")
- weaponIconTag.Value = IconURL
- weaponIconTag.Name = "icon"
- weaponIconTag.Parent = creatorTag
- end
- local function CreateBullet(bulletPos)
- local bullet = Instance.new('Part', Workspace)
- bullet.FormFactor = Enum.FormFactor.Custom
- bullet.Size = Vector3.new(0.1, 0.1, 0.1)
- bullet.BrickColor = BrickColor.new("Black")
- bullet.Shape = Enum.PartType.Block
- bullet.CanCollide = false
- bullet.CFrame = CFrame.new(bulletPos)
- bullet.Anchored = true
- bullet.TopSurface = Enum.SurfaceType.Smooth
- bullet.BottomSurface = Enum.SurfaceType.Smooth
- bullet.Name = 'Bullet'
- DebrisService:AddItem(bullet, 2.5)
- local shell = Instance.new("Part")
- shell.CFrame = Tool.Handle.CFrame * CFrame.fromEulerAnglesXYZ(1.5,0,0)
- shell.Size = Vector3.new(1,1,1)
- shell.BrickColor = BrickColor.new(226)
- shell.Parent = game.Workspace
- shell.CFrame = script.Parent.Handle.CFrame
- shell.CanCollide = false
- shell.Transparency = 0
- shell.BottomSurface = 0
- shell.TopSurface = 0
- shell.Name = "Shell"
- shell.Velocity = Tool.Handle.CFrame.lookVector * 35 + Vector3.new(math.random(-10,10),20,math.random(-10,20))
- shell.RotVelocity = Vector3.new(0,200,0)
- DebrisService:AddItem(shell, 1)
- local shellmesh = Instance.new("SpecialMesh")
- shellmesh.Scale = Vector3.new(.15,.4,.15)
- shellmesh.Parent = shell
- return bullet
- end
- local function Reload()
- if not Reloading then
- Reloading = true
- -- Don't reload if you are already full or have no extra ammo
- if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
- if RecoilTrack then
- RecoilTrack:Stop()
- end
- if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
- if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
- WeaponGui.Crosshair.ReloadingLabel.Visible = true
- end
- end
- if ReloadTrack then
- ReloadTrack:Play()
- end
- script.Parent.Handle.Reload:Play()
- wait(ReloadTime)
- -- Only use as much ammo as you have
- local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
- AmmoInClip = AmmoInClip + ammoToUse
- SpareAmmo = SpareAmmo - ammoToUse
- UpdateAmmo(AmmoInClip)
- --WeaponGui.Reload.Visible = false
- if ReloadTrack then
- ReloadTrack:Stop()
- end
- end
- Reloading = false
- end
- end
- function OnFire()
- if IsShooting then return end
- if MyHumanoid and MyHumanoid.Health > 0 then
- if RecoilTrack and AmmoInClip > 0 then
- RecoilTrack:Play()
- end
- IsShooting = true
- while LeftButtonDown and AmmoInClip > 0 and not Reloading do
- if Spread and not DecreasedAimLastShot then
- Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
- UpdateCrosshair(Spread)
- end
- DecreasedAimLastShot = not DecreasedAimLastShot
- if Handle:FindFirstChild('FireSound') then
- Pitch.Pitch = .8 + (math.random() * .5)
- Handle.FireSound:Play()
- Handle.Flash.Enabled = true
- flare.MuzzleFlash.Enabled = true
- --Handle.Smoke.Enabled=true --This is optional
- end
- if MyMouse then
- local targetPoint = MyMouse.Hit.p
- local shootDirection = (targetPoint - Handle.Position).unit
- -- Adjust the shoot direction randomly off by a little bit to account for recoil
- shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
- (0.5 - math.random()) * 2 * Spread,
- (0.5 - math.random()) * 2 * Spread) * shootDirection
- local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
- local bullet
- -- Create a bullet here
- if hitObject then
- bullet = CreateBullet(bulletPos)
- end
- if hitObject and hitObject.Parent then
- local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
- if hitHumanoid then
- local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
- if MyPlayer.Neutral or (hitPlayer and hitPlayer.TeamColor ~= MyPlayer.TeamColor) then
- TagHumanoid(hitHumanoid, MyPlayer)
- hitHumanoid:TakeDamage(Damage)
- if bullet then
- bullet:Destroy()
- bullet = nil
- WeaponGui.Crosshair.Hit:Play()
- --bullet.Transparency = 1
- end
- Spawn(UpdateTargetHit)
- end
- end
- end
- AmmoInClip = AmmoInClip - 1
- UpdateAmmo(AmmoInClip)
- end
- wait(FireRate)
- end
- Handle.Flash.Enabled = false
- IsShooting = false
- flare.MuzzleFlash.Enabled = false
- --Handle.Smoke.Enabled=false --This is optional
- if AmmoInClip == 0 then
- Handle.Tick:Play()
- --WeaponGui.Reload.Visible = true
- Reload()
- end
- if RecoilTrack then
- RecoilTrack:Stop()
- end
- end
- end
- local TargetHits = 0
- function UpdateTargetHit()
- TargetHits = TargetHits + 1
- if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
- WeaponGui.Crosshair.TargetHitImage.Visible = true
- end
- wait(0.5)
- TargetHits = TargetHits - 1
- if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
- WeaponGui.Crosshair.TargetHitImage.Visible = false
- end
- end
- function UpdateCrosshair(value, mouse)
- if WeaponGui then
- local absoluteY = 650
- WeaponGui.Crosshair:TweenSize(
- UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Linear,
- 0.33)
- end
- end
- function UpdateAmmo(value)
- if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
- WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
- if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
- WeaponGui.Crosshair.ReloadingLabel.Visible = false
- end
- end
- if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
- WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
- end
- end
- function OnMouseDown()
- LeftButtonDown = true
- OnFire()
- end
- function OnMouseUp()
- LeftButtonDown = false
- end
- function OnKeyDown(key)
- if string.lower(key) == 'r' then
- Reload()
- if RecoilTrack then
- RecoilTrack:Stop()
- end
- end
- end
- function OnEquipped(mouse)
- Handle.EquipSound:Play()
- Handle.EquipSound2:Play()
- Handle.UnequipSound:Stop()
- RecoilAnim = WaitForChild(Tool, 'Recoil')
- ReloadAnim = WaitForChild(Tool, 'Reload')
- FireSound = WaitForChild(Handle, 'FireSound')
- MyCharacter = Tool.Parent
- MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
- MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
- MyTorso = MyCharacter:FindFirstChild('Torso')
- MyMouse = mouse
- WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
- if WeaponGui and MyPlayer then
- WeaponGui.Parent = MyPlayer.PlayerGui
- UpdateAmmo(AmmoInClip)
- end
- if RecoilAnim then
- RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
- end
- if ReloadAnim then
- ReloadTrack = MyHumanoid:LoadAnimation(ReloadAnim)
- end
- if MyMouse then
- -- Disable mouse icon
- MyMouse.Icon = "http://www.roblox.com/asset/?id=18662154"
- MyMouse.Button1Down:connect(OnMouseDown)
- MyMouse.Button1Up:connect(OnMouseUp)
- MyMouse.KeyDown:connect(OnKeyDown)
- end
- end
- -- Unequip logic here
- function OnUnequipped()
- Handle.UnequipSound:Play()
- Handle.EquipSound:Stop()
- Handle.EquipSound2:Stop()
- LeftButtonDown = false
- flare.MuzzleFlash.Enabled = false
- Reloading = false
- MyCharacter = nil
- MyHumanoid = nil
- MyTorso = nil
- MyPlayer = nil
- MyMouse = nil
- if OnFireConnection then
- OnFireConnection:disconnect()
- end
- if OnReloadConnection then
- OnReloadConnection:disconnect()
- end
- if FlashHolder then
- FlashHolder = nil
- end
- if WeaponGui then
- WeaponGui.Parent = nil
- WeaponGui = nil
- end
- if RecoilTrack then
- RecoilTrack:Stop()
- end
- if ReloadTrack then
- ReloadTrack:Stop()
- end
- end
- local function SetReticleColor(color)
- if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
- for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
- if line:IsA('Frame') then
- line.BorderColor3 = color
- end
- end
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Unequipped:connect(OnUnequipped)
- while true do
- wait(0.033)
- if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
- WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
- SetReticleColor(NeutralReticleColor)
- local target = MyMouse.Target
- if target and target.Parent then
- local player = PlayersService:GetPlayerFromCharacter(target.Parent)
- if player then
- if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
- SetReticleColor(EnemyReticleColor)
- else
- SetReticleColor(FriendlyReticleColor)
- end
- end
- end
- end
- if Spread and not IsShooting then
- local currTime = time()
- if currTime - LastSpreadUpdate > FireRate * 2 then
- LastSpreadUpdate = currTime
- Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
- UpdateCrosshair(Spread, MyMouse)
- end
- end
- end
- end))
- Script13.Name = "WeldingDoNotDelete"
- Script13.Parent = Tool1
- table.insert(cors,sandbox(Script13,function()
- --DO NOT DELETE, THIS WILL BREAK THE GUN
- function Stick(x, y)
- local W = Instance.new("Weld")
- W.Part0 = x
- W.Part1 = y
- local CJ = CFrame.new(x.Position)
- local C0 = x.CFrame:inverse()*CJ
- local C1 = y.CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = x
- end
- function Get(A)
- if A.ClassName == ("Part") then
- Stick(script.Parent.Handle, A)
- A.Anchored = false
- else
- local C = A:GetChildren()
- for i=1, #C do
- Get(C[i])
- end
- end
- end
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- Part14.Name = "Flare"
- Part14.Parent = Tool1
- 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)
- Part14.Position = Vector3.new(-4.87999678, 0.979990602, -39.1899796)
- Part14.Transparency = 1
- Part14.Size = Vector3.new(1, 1, 1)
- Part14.CanCollide = false
- Part14.FormFactor = Enum.FormFactor.Symmetric
- Part14.formFactor = Enum.FormFactor.Symmetric
- BillboardGui15.Name = "MuzzleFlash"
- BillboardGui15.Parent = Part14
- BillboardGui15.Enabled = false
- BillboardGui15.Size = UDim2.new(2, 0, 2, 0)
- ImageLabel16.Name = "Img"
- ImageLabel16.Parent = BillboardGui15
- ImageLabel16.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel16.BackgroundTransparency = 1
- ImageLabel16.Image = "http://www.roblox.com/asset/?ID=103740493"
- Script17.Parent = ImageLabel16
- table.insert(cors,sandbox(Script17,function()
- local imgs = {103740493,103804266,103804383}
- for _,v in pairs(imgs) do
- game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?ID="..v)
- end
- script.Parent.Parent.Changed:connect(function ()
- if script.Parent.Parent.Enabled == true then
- wait(0.09)
- script.Parent.Parent.Enabled = false
- end
- end)
- while true do
- for i = 1,#imgs do
- script.Parent.Image = "http://www.roblox.com/asset/?ID="..imgs[i]
- wait(0.03)
- end
- end
- end))
- Animation18.Name = "Reload"
- Animation18.Parent = Tool1
- Animation18.AnimationId = "http://www.roblox.com/Asset?ID=95384819"
- Script19.Name = "Readme From Destiny"
- Script19.Parent = Tool1
- table.insert(cors,sandbox(Script19,function()
- --[[HANDGUN v1.2 CREATED BY DESTINYHARBINGER
- A fully working, non virus riddled, and decently realistic up to date handgun made from a Unioned Part
- made from solid modeling. This weapon is actually an edited Template Assualt Rifle you can see from those
- broken template games. Modified to become more modern and up to date.
- This weapon features:
- -Anti Teamkill
- -Flashes and Flares and Bears Oh My!
- -Reloading (WOWWWWWWW)
- -IOS and Android Compatibility (Tested and Approved)
- -No virus junk.
- -Animations (will improve later)
- -Easy to edit script!
- -Decent pistol sounds!
- -Non-laggy! Only 2 parts and thats it!
- -and not so much more because its just a regular gun!!!!!!!
- )))))))))IMPORTANT:
- DO NOT DELETE, UNUNION, OR CHANGE NAMES OF ANYTHING UNLESS YOU ARE AN EXPERT AT DOING THAT BUISNESS.
- TREAD CAREFULLY.
- ~PATCH NOTES~
- v1.2
- -Tool not working if in starterpack has been fixed by Luckymaxer.
- -Minor HUD changes.
- v1.1
- -Smoke is now disabled. Go through the handgun script and CTRL + F, search smoke, and uncomment the options
- for it to work again.
- -Shell casings have been added
- -When sucessfully hitting someone, a local sound is played to indicate a hit.
- -Works with mobile now. Thats right, you can now use it on iPhone Sean.
- -Changed Equipping sounds.
- ______ _____ _____ _____ _____ _ _ __ __
- | _ \| ___|/ ___||_ _||_ _|| \ | |\ \ / /
- | | | || |__ \ `--. | | | | | \| | \ V /
- | | | || __| `--. \ | | | | | . ` | \ /
- | |/ / | |___ /\__/ / | | _| |_ | |\ | | |
- |___/ \____/ \____/ \_/ \___/ \_| \_/ \_/
- _ _ ___ ______ ______ _____ _ _ _____ _____ ______
- | | | | / _ \ | ___ \| ___ \|_ _|| \ | || __ \| ___|| ___ \
- | |_| |/ /_\ \| |_/ /| |_/ / | | | \| || | \/| |__ | |_/ /
- | _ || _ || / | ___ \ | | | . ` || | __ | __| | /
- | | | || | | || |\ \ | |_/ / _| |_ | |\ || |_\ \| |___ | |\ \
- \_| |_/\_| |_/\_| \_|\____/ \___/ \_| \_/ \____/\____/ \_| \_|
- __ __ _____ _____ _____ ______ _____ _____ __ _____
- / / \ \ / __ \| _ || _ ||___ / / __ \| _ |/ | | ___|
- | | ___ | | `' / /'| |/' || |/' | / /______`' / /'| |/' |`| | |___ \
- | | / __|| | / / | /| || /| | / /|______| / / | /| | | | \ \
- | || (__ | | ./ /___\ |_/ /\ |_/ /./ / ./ /___\ |_/ /_| |_/\__/ /
- | | \___|| | \_____/ \___/ \___/ \_/ \_____/ \___/ \___/\____/
- \_\ /_/
- If you can, leave me some credit k ;)
- ]]
- end))
- Camera20.Name = "ThumbnailCamera"
- Camera20.Parent = Tool1
- 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)
- 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)
- Camera20.FieldOfView = 25.000000418326
- Camera20.Focus = CFrame.new(-5.71727037, 1.17730594, -38.9328079, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Camera20.focus = CFrame.new(-5.71727037, 1.17730594, -38.9328079, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- ScreenGui21.Name = "WeaponHud"
- ScreenGui21.Parent = Tool1
- Frame22.Name = "AmmoHud"
- Frame22.Parent = ScreenGui21
- Frame22.Position = UDim2.new(1, -265, 1, -60)
- Frame22.Size = UDim2.new(0, 200, 0, 50)
- Frame22.BackgroundTransparency = 1
- Frame22.BorderSizePixel = 0
- TextLabel23.Name = "ForwardSlash"
- TextLabel23.Parent = Frame22
- TextLabel23.Position = UDim2.new(0.5, 0, 0.5, 0)
- TextLabel23.BackgroundTransparency = 1
- TextLabel23.BorderSizePixel = 0
- TextLabel23.Font = Enum.Font.SourceSans
- TextLabel23.FontSize = Enum.FontSize.Size24
- TextLabel23.Text = "/"
- TextLabel23.TextColor = BrickColor.new("Institutional white")
- TextLabel23.TextColor3 = Color3.new(1, 1, 1)
- TextLabel23.TextScaled = true
- TextLabel23.TextSize = 24
- TextLabel23.TextStrokeTransparency = 0
- TextLabel23.TextWrap = true
- TextLabel23.TextWrapped = true
- TextLabel24.Name = "ClipAmmo"
- TextLabel24.Parent = Frame22
- TextLabel24.Position = UDim2.new(0.449999988, 0, 0.5, 0)
- TextLabel24.BackgroundTransparency = 1
- TextLabel24.BorderSizePixel = 0
- TextLabel24.Font = Enum.Font.SourceSansBold
- TextLabel24.FontSize = Enum.FontSize.Size24
- TextLabel24.Text = "54"
- TextLabel24.TextColor = BrickColor.new("Institutional white")
- TextLabel24.TextColor3 = Color3.new(1, 1, 1)
- TextLabel24.TextScaled = true
- TextLabel24.TextSize = 24
- TextLabel24.TextStrokeTransparency = 0
- TextLabel24.TextWrap = true
- TextLabel24.TextWrapped = true
- TextLabel24.TextXAlignment = Enum.TextXAlignment.Right
- TextLabel25.Name = "TotalAmmo"
- TextLabel25.Parent = Frame22
- TextLabel25.Position = UDim2.new(0.550000012, 0, 0.5, 0)
- TextLabel25.BackgroundTransparency = 1
- TextLabel25.BorderSizePixel = 0
- TextLabel25.Font = Enum.Font.SourceSans
- TextLabel25.FontSize = Enum.FontSize.Size24
- TextLabel25.Text = "180"
- TextLabel25.TextColor = BrickColor.new("Institutional white")
- TextLabel25.TextColor3 = Color3.new(1, 1, 1)
- TextLabel25.TextScaled = true
- TextLabel25.TextSize = 24
- TextLabel25.TextStrokeTransparency = 0
- TextLabel25.TextWrap = true
- TextLabel25.TextWrapped = true
- TextLabel25.TextXAlignment = Enum.TextXAlignment.Left
- ImageLabel26.Parent = Frame22
- ImageLabel26.Size = UDim2.new(0, 200, 0, 50)
- ImageLabel26.BackgroundColor = BrickColor.new("Institutional white")
- ImageLabel26.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel26.BackgroundTransparency = 1
- ImageLabel26.BorderColor = BrickColor.new("Really black")
- ImageLabel26.BorderColor3 = Color3.new(0, 0, 0)
- ImageLabel26.BorderSizePixel = 0
- ImageLabel26.Image = "rbxassetid://51219827"
- ImageLabel26.ImageColor3 = Color3.new(0.352941, 0.352941, 0.352941)
- ImageLabel26.ImageTransparency = 0.20000000298023
- Frame27.Name = "Crosshair"
- Frame27.Parent = ScreenGui21
- Frame27.Position = UDim2.new(0, 500, 0, 500)
- Frame27.Size = UDim2.new(0, 150, 0, 150)
- Frame27.BackgroundColor = BrickColor.new("Lime green")
- Frame27.BackgroundColor3 = Color3.new(0, 1, 0)
- Frame27.BackgroundTransparency = 1
- Frame27.BorderSizePixel = 0
- Frame28.Name = "TopFrame"
- Frame28.Parent = Frame27
- Frame28.Position = UDim2.new(0, -1, -0.5, -7)
- Frame28.Size = UDim2.new(0, 2, 0, 14)
- Frame28.BackgroundColor = BrickColor.new("Really black")
- Frame28.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame28.BorderColor = BrickColor.new("Institutional white")
- Frame28.BorderColor3 = Color3.new(1, 1, 1)
- Frame29.Name = "RightFrame"
- Frame29.Parent = Frame27
- Frame29.Position = UDim2.new(0.5, -7, 0, -1)
- Frame29.Size = UDim2.new(0, 14, 0, 2)
- Frame29.BackgroundColor = BrickColor.new("Really black")
- Frame29.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame29.BorderColor = BrickColor.new("Institutional white")
- Frame29.BorderColor3 = Color3.new(1, 1, 1)
- Frame30.Name = "LeftFrame"
- Frame30.Parent = Frame27
- Frame30.Position = UDim2.new(-0.5, -7, 0, -1)
- Frame30.Size = UDim2.new(0, 14, 0, 2)
- Frame30.BackgroundColor = BrickColor.new("Really black")
- Frame30.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame30.BorderColor = BrickColor.new("Institutional white")
- Frame30.BorderColor3 = Color3.new(1, 1, 1)
- ImageLabel31.Name = "TargetHitImage"
- ImageLabel31.Parent = Frame27
- ImageLabel31.Position = UDim2.new(0, -25, 0, -25)
- ImageLabel31.Visible = false
- ImageLabel31.Size = UDim2.new(0, 50, 0, 50)
- ImageLabel31.BackgroundTransparency = 1
- ImageLabel31.BorderSizePixel = 0
- ImageLabel31.Image = "http://www.roblox.com/asset/?id=115400215"
- TextLabel32.Name = "ReloadingLabel"
- TextLabel32.Parent = Frame27
- TextLabel32.Position = UDim2.new(0, 20, 0, -20)
- TextLabel32.Visible = false
- TextLabel32.BackgroundTransparency = 1
- TextLabel32.BorderSizePixel = 0
- TextLabel32.Font = Enum.Font.ArialBold
- TextLabel32.FontSize = Enum.FontSize.Size18
- TextLabel32.Text = "Reloading"
- TextLabel32.TextColor = BrickColor.new("Crimson")
- TextLabel32.TextColor3 = Color3.new(0.568627, 0, 0)
- TextLabel32.TextSize = 18
- TextLabel32.TextStrokeTransparency = 0
- TextLabel32.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel32.TextYAlignment = Enum.TextYAlignment.Bottom
- Frame33.Name = "BottomFrame"
- Frame33.Parent = Frame27
- Frame33.Position = UDim2.new(0, -1, 0.5, -7)
- Frame33.Size = UDim2.new(0, 2, 0, 14)
- Frame33.BackgroundColor = BrickColor.new("Really black")
- Frame33.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame33.BorderColor = BrickColor.new("Institutional white")
- Frame33.BorderColor3 = Color3.new(1, 1, 1)
- Sound34.Name = "Hit"
- Sound34.Parent = Frame27
- Sound34.SoundId = "rbxassetid://160432334"
- Sound34.Volume = 1
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement