Awm
Awm
Player = game:GetService("Players").LocalPlayer
Char = Player.Character
animate = Char:findFirstChild("Animate")
if animate then
animate:Destroy()
end
Name = "Overkill"
MC = BrickColor.new("Really black")
DC = BrickColor.new("Really black")
GC = BrickColor.new("Earth green")
WC = BrickColor.new("Earth green")
BC = BrickColor.new("Really black")
Raycast = false
Ghillie = true
WSPenalty = 12
Bipod = true
Chambered = false
MR = 0
GR = 0
selected = false
canDual = false
dual = false
Button1Down = false
damage = 55
canFire = true
canFire2 = false
readyTime = 1.8
automatic = false
burst = false
burstCount = 0
burstCountMax = 2
canSilence = true
silenced = false
canZoom = true
zoom = false
switchToSingle = false
switchToBurst = false
switchToAutomatic = false
ammoGui = Instance.new("ScreenGui")
ammoGui.Name = Name
local frame = Instance.new("Frame")
frame.Name = "Frame"
frame.Size = UDim2.new(0, 165, 0, 60)
frame.Position = UDim2.new(0, 0, 1, -400)
frame.BackgroundColor3 = Color3.new(1, 1, 1)
frame.BorderColor3 = Color3.new(0, 0, 0)
frame.Parent = ammoGui
local label = Instance.new("TextLabel")
label.Name = "Weapon"
label.Text = "Weapon: " ..Name
label.Size = UDim2.new(1, 0, 0, 20)
label.Position = UDim2.new(0, 0, 0, 0)
label.BackgroundColor3 = Color3.new(1, 0, 0)
label.BorderColor3 = Color3.new(0, 0, 0)
label.Parent = frame
local label = Instance.new("TextLabel")
label.Name = "MagazinePrefix"
label.Text = " Magazine:"
label.TextXAlignment = "Left"
label.Size = UDim2.new(1, 0, 0, 20)
label.Position = UDim2.new(0, 0, 0, 20)
label.BackgroundColor3 = Color3.new(1, 1, 1)
label.BorderColor3 = Color3.new(0, 0, 0)
label.Parent = frame
local label = Instance.new("TextLabel")
label.Name = "Magazine"
label.Text = "0/0"
label.TextXAlignment = "Right"
label.Size = UDim2.new(1, 0, 0, 20)
label.Position = UDim2.new(0, -10, 0, 20)
label.BackgroundTransparency = 1
label.BorderSizePixel = 0
label.Parent = frame
local label = Instance.new("TextLabel")
label.Name = "AmmoPrefix"
label.Text = " 8.6x70mm:"
label.TextXAlignment = "Left"
label.Size = UDim2.new(1, 0, 0, 20)
label.Position = UDim2.new(0, 0, 0, 40)
label.BackgroundColor3 = Color3.new(1, 1, 1)
label.BorderColor3 = Color3.new(0, 0, 0)
label.Parent = frame
local label = Instance.new("TextLabel")
label.Name = "Ammo"
label.Text = "0/0"
label.TextXAlignment = "Right"
label.Size = UDim2.new(1, 0, 0, 20)
label.Position = UDim2.new(0, -10, 0, 40)
label.BackgroundTransparency = 1
label.BorderSizePixel = 0
label.Parent = frame
function updateGui()
if selected == false then return end
if Player:FindFirstChild("PlayerGui") == nil then
Instance.new("PlayerGui").Parent = Player end
if Player.PlayerGui:FindFirstChild(Name) == nil then
ammoGui:Clone().Parent = Player.PlayerGui
end
Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value)..
"/" ..tostring(magazineMax.Value)
Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/"
..tostring(ammoMax.Value)
end
function makeParts(format)
local model = Instance.new("Model")
model.Name = Name
local pm = Instance.new("Part")
pm.Material = "Grass"
pm.Name = "Handle"
pm.formFactor = "Symmetric"
pm.Size = Vector3.new(1, 1, 1)
pm.BrickColor = GC
pm.Reflectance = GR
pm.CanCollide = false
pm.Transparency = 1
pm.Locked = true
pm.TopSurface = 0
pm.BottomSurface = 0
pm.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.28, 1.1, 0.19)
m.Offset = Vector3.new(0, -0.25, 0.07)
m.Parent = pm
if format ~= nil then
local w = Instance.new("Weld")
w.Part0 = pm
if format == "RightHand" then
w.Part1 = Player.Character:FindFirstChild("Right Arm")
w.C0 = CFrame.new(0, 1.15, 0.7)
w.C1 = CFrame.new()
elseif format == "RightHolster" then
w.Part1 = Player.Character:FindFirstChild("Torso")
w.C0 = CFrame.new(0.65, -0.85, 0.4) *
CFrame.fromEulerAnglesXYZ(math.rad(32), math.rad(-90), 0)
w.C1 = CFrame.new()
model.Name = Name.. " (Holstered)"
end
w.Parent = pm
model.Parent = Player.Character
end
--[[
sniper1 http://www.roblox.com/asset/?id=1868836
equip http://www.roblox.com/asset/?id=13510737
fire1 http://www.roblox.com/asset/?id=2760979
fire2 http://www.roblox.com/asset/?id=13510352
fire3 http://www.roblox.com/asset/?id=2692806
fire4 http://www.roblox.com/asset/?id=2691586 possible
fire5 http://www.roblox.com/asset/?id=2920959
fire6 http://www.roblox.com/asset/?id=2697431
fire7 http://www.roblox.com/asset/?id=2920959
reload1 http://www.roblox.com/asset/?id=2691591
reload2 http://www.roblox.com/asset/?id=2697432
reload3 http://www.roblox.com/asset/?id=2920960
reload4 http://www.roblox.com/asset/?id=2761842
shotgun1 http://www.roblox.com/asset/?id=2697294
--]]
local s = Instance.new("Sound")
s.Name = "Fire"
s.SoundId = "http://www.roblox.com/Asset/?id=132572951"
s.Volume = 0.4
s.Pitch = 1
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Fire2"
s.SoundId = "http://roblox.com/asset/?id=2691586"
s.Volume = 1
s.Pitch = 1.4
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Equip"
s.SoundId = "http://www.roblox.com/asset/?id=10209881"
s.Volume = 1
s.Pitch = 0.6
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Release"
s.SoundId = "http://www.roblox.com/Asset/?id=10209813"
s.Volume = 1
s.Pitch = 3
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Reload"
s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
s.Volume = 1
s.Pitch = 8
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Action2"
s.SoundId = "http://www.roblox.com/Asset/?id=2697295"
s.Volume = 1
s.Pitch = 1
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Action1"
s.SoundId = "http://www.roblox.com/Asset/?id=10209834"
s.Volume = 0.7
s.Pitch = 1.5
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Action3"
s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
s.Volume = 0.6
s.Pitch = 2.5
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Empty"
s.SoundId = "http://www.roblox.com/asset/?id=2697295"
s.Volume = 1
s.Pitch = 5
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Switch"
s.SoundId = "http://www.roblox.com/asset/?id=2697295"
s.Volume = 1
s.Pitch = 10
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Bullet"
s.SoundId = "http://www.roblox.com/Asset/?id=18426149"
s.Volume = 1
s.Pitch = 1
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Jam"
s.SoundId = "http://www.roblox.com/Asset/?id=10209636"
s.Volume = 1
s.Pitch = 2
s.Looped = false
s.Parent = pm
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "ShellOut"
p.formFactor = "Custom"
p.Size = Vector3.new(0.2, 0.2, 0.2)
p.Transparency = 1
p.Locked = true
p.CanCollide = false
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(-0.06, 0.62, -0.06) * CFrame.fromEulerAnglesXYZ(0,
math.rad(90), 0)
w.C1 = CFrame.new()
w.Parent = p--]]
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "Grip"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.3, 0.38, 0.8)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, -0.15, -0.46) * CFrame.fromEulerAnglesXYZ(math.rad(15),
0, 0)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Magazine"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.2, 0.5, 0.5)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0.5, -0.24)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Trigger Housing"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = MC
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.2, 0.4, 0.04)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0.1, -0.36)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Trigger"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BrickColor.new("Dark stone grey")
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.18, 0.18, 0.18)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0.02, -0.25)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "Body1" --------------
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.3, 0.6, 0.38)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0.5, -0.12)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "Body3" --------------
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.3, 1.4, 0.32)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 1.5, -0.09)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Body2"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Brick"
m.Scale = Vector3.new(0.32, 1.4, 0.2)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 1.48, -0.08)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "GripAngle1"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Wedge"
m.Scale = Vector3.new(0.3, 0.14, 0.6)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, -0.38, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270),
0, math.rad(180))
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Material = "Grass"
p.Name = "GripAngle2"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Wedge"
m.Scale = Vector3.new(0.3, 0.38, 0.7)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, -0.12, 1.14) * CFrame.fromEulerAnglesXYZ(math.rad(270),
0, math.rad(180))
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "GripTrigHous"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.3, 0.4, 0.1)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0, -0.4)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "GripCover"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.3, 1, 0.3)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0.35, -0.08)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "BoltBlock" --------------
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Brick"
m.Scale = Vector3.new(0.28, 1.2, 0.3)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0.35, 0.06)
w.C1 = CFrame.new()
w.Parent = p
local pb = Instance.new("Part")
pb.Material = "SmoothPlastic"
pb.Name = "Bolt"
pb.formFactor = "Symmetric"
pb.Size = Vector3.new(1, 1, 1)
pb.BrickColor = BC
pb.Reflectance = MR
pb.Transparency = 0
pb.CanCollide = false
pb.Locked = true
pb.TopSurface = 0
pb.BottomSurface = 0
pb.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Brick"
m.Scale = Vector3.new(0.26, 0.26, 0.26)
m.Parent = pb
local w = Instance.new("Weld")
w.Part0 = pb
w.Part1 = pm
w.C0 = CFrame.new(0, -0.2, 0.06)
w.C1 = CFrame.new()
w.Parent = pb
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Bolt 1"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BC
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.16, 0.6, 0.16)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pb
w.C0 = CFrame.new(0, 0.28, 0)
w.C1 = CFrame.new()
w.Parent = p
local pbb = Instance.new("Part")
pbb.Material = "SmoothPlastic"
pbb.Name = "BoltKnob"
pbb.formFactor = "Symmetric"
pbb.Size = Vector3.new(1, 1, 1)
pbb.BrickColor = BC
pbb.Reflectance = MR
pbb.CanCollide = false
pbb.Locked = true
pbb.TopSurface = 0
pbb.BottomSurface = 0
pbb.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.2, 0.08, 0.08)
m.Parent = pbb
local w = Instance.new("Weld")
w.Part0 = pbb
w.Part1 = pb
w.C0 = CFrame.new(-0.2, 0, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(20), 0)
w.C1 = CFrame.new()
w.Parent = pbb
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Bolt 2"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BC
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Sphere"
m.Scale = Vector3.new(0.18, 0.18, 0.18)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pbb
w.C0 = CFrame.new(-0.15, 0, 0)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Barrel 1"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.18, 3, 0.18)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 2.1, 0.06)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Barrel 2"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.1, 3, 0.2)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 2.1, 0.06)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Barrel 3"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.2, 3, 0.1)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 2.1, 0.06)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
if silenced == false then
p.Name = "Muzzle"
else
p.Name = "Muzzle 2"
end
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.24, 0.8, 0.24)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 3.5, 0.06)
w.C1 = CFrame.new()
w.Parent = p
local s = Instance.new("Smoke")
s.Enabled = false
s.Name = "Smoke"
s.RiseVelocity = -5
s.Opacity = 0.5
s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
s.Size = 2.4
s.Parent = p
local f = Instance.new("Fire")
f.Enabled = false
f.Name = "Fire"
f.Heat = -20
f.Size = 3.6
f.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "MuzzleHole"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BrickColor.new("Really black")
p.Reflectance = MR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.16, 0.8, 0.16)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 3.504, 0.06)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
if silenced == false then
p.Name = "Silencer"
p.Transparency = 1
else
p.Name = "Muzzle"
p.Transparency = 0
end
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = MC
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.26, 1, 0.26)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 4, 0.06)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "Silencer1"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.CanCollide = false
if silenced == false then
p.Transparency = 1
else
p.Transparency = 0
end
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.261, 0.6, 0.261)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 4.1, 0.06)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Silencer2"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BrickColor.new("Really black")
p.CanCollide = false
if silenced == false then
p.Transparency = 1
else
p.Transparency = 0
end
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.16, 1.002, 0.16)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 4, 0.06)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Material = "Grass"
p.Name = "GripStock"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.3, 0.8, 0.3)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, -0.6, -0.72) * CFrame.fromEulerAnglesXYZ(math.rad(20),
0, 0)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part") -- Standard Stock
p.Material = "SmoothPlastic"
p.Material = "Grass"
p.Name = "StockT"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.3, 1.4, 0.25)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, -0.6, -0.1)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "CheekRest" --------------
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Brick"
m.Scale = Vector3.new(0.26, 0.6, 0.3)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, -0.84, -0.04)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Stock1"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.34, 0.4, 0.7)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, -1.38, -0.3)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "Stock2"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = GC
p.Reflectance = GR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.3, 0.4, 0.5)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, -0.38, -1) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0,
math.rad(180))
w.C1 = CFrame.new()
w.Parent = p--]]
local ps = Instance.new("Part") -- Scope
ps.Material = "SmoothPlastic"
ps.Name = "Scope Center 1"
ps.CanCollide = false
ps.formFactor = "Symmetric"
ps.Size = Vector3.new(1, 1, 1)
ps.BrickColor = DC
ps.Reflectance = MR
ps.Locked = true
ps.TopSurface = 0
ps.BottomSurface = 0
ps.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.2, 0.8, 0.2)
m.Parent = ps
local w = Instance.new("Weld")
w.Part0 = ps
w.Part1 = pm
w.C0 = CFrame.new(0, 0.3, 0.38)
w.C1 = CFrame.new()
w.Parent = ps
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Scope Knob"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.18, 0.26, 0.18)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = ps
w.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Scope Knob2"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.16, 0.26, 0.16)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = ps
w.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Scope Base"
p.formFactor = "Symmetric"
p.CanCollide = false
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.1, 0.14, 0.4)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = ps
w.C0 = CFrame.new(0, -0.2, -0.18)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Scope Base"
p.formFactor = "Symmetric"
p.CanCollide = false
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.1, 0.14, 0.4)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = ps
w.C0 = CFrame.new(0, 0.2, -0.18)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Scope Back"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.24, 0.375, 0.24)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = ps
w.C0 = CFrame.new(0, -0.5, 0)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Scope Front"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.28, 0.7, 0.28)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = ps
w.C0 = CFrame.new(0, 0.64, 0)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Scope Window F"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BrickColor.new("White")
p.Reflectance = 0.3
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.27, 0.7, 0.27)
m.Offset = Vector3.new(0, -0.003 ,0)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = ps
w.C0 = CFrame.new(0, 0.64, 0)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Scope Window B"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BrickColor.new("White")
p.Reflectance = 0.3
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.23, 0.375, 0.23)
m.Offset = Vector3.new(0, 0.003 ,0)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = ps
w.C0 = CFrame.new(0, -0.5, 0)
w.C1 = CFrame.new()
w.Parent = p--]]
if Ghillie == true then --Ghillie Wrap
local pa = Instance.new("Part")
pa.Material = "Grass"
pa.Name = "Wrap1"
pa.CanCollide = false
pa.formFactor = "Symmetric"
pa.Size = Vector3.new(1, 1, 1)
pa.BrickColor = WC
pa.Locked = true
pa.TopSurface = 0
pa.BottomSurface = 0
pa.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.29, 0.6, 0.29)
m.Parent = pa
local w = Instance.new("Weld")
w.Part0 = pa
w.Part1 = pm
w.C0 = CFrame.new(0, 0.95, 0.38)
w.C1 = CFrame.new()
w.Parent = pa
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "Wrap1"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = WC
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.05, 0.4, 0.29)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pa
w.C0 = CFrame.new(-0.115, 0.1, -0.125)
w.C1 = CFrame.new()
w.Parent = p
local pa1 = Instance.new("Part")
pa1.Material = "Grass"
pa1.Name = "Wrap2"
pa1.CanCollide = false
pa1.formFactor = "Symmetric"
pa1.Size = Vector3.new(1, 1, 1)
pa1.BrickColor = WC
pa1.Locked = true
pa1.TopSurface = 0
pa1.BottomSurface = 0
pa1.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.27, 0.4, 0.27)
m.Parent = pa1
local w = Instance.new("Weld")
w.Part0 = pa1
w.Part1 = pm
w.C0 = CFrame.new(0, 3.5, 0.06)
w.C1 = CFrame.new()
w.Parent = pa1
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "Wrap2"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = WC
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.05, 0.2, 0.27)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pa1
w.C0 = CFrame.new(0.1, 0.1, -0.125)
w.C1 = CFrame.new()
w.Parent = p
local pa2 = Instance.new("Part")
pa2.Material = "Grass"
pa2.Name = "Wrap3"
pa2.CanCollide = false
pa2.formFactor = "Symmetric"
pa2.Size = Vector3.new(1, 1, 1)
pa2.BrickColor = WC
pa2.Locked = true
pa2.TopSurface = 0
pa2.BottomSurface = 0
pa2.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.23, 0.6, 0.23)
m.Parent = pa2
local w = Instance.new("Weld")
w.Part0 = pa2
w.Part1 = pm
w.C0 = CFrame.new(0, 2.8, 0.06)
w.C1 = CFrame.new()
w.Parent = pa2
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "Wrap3"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = WC
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.05, 0.4, 0.21)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pa2
w.C0 = CFrame.new(-0.08, 0.1, -0.125)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "Grass"
p.Name = "Wrap3"
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = WC
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.05, 0.2, 0.21)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pa2
w.C0 = CFrame.new(0.08, -0.1, -0.125)
w.C1 = CFrame.new()
w.Parent = p
end
if Bipod == true then
local p = Instance.new("Part") ---Bipod
p.Material = "SmoothPlastic"
p.Name = "BipodM" --------------
p.CanCollide = false
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.17, 0.25, 0.2)
m.Offset = Vector3.new(0, 0, 0.35)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 2.1, 0.05)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "BipodArm"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.CanCollide = false
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.15, 1, 0.15)
m.Offset = Vector3.new(0.09, -0.4 ,0.4)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 2.1, 0.05)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "BipodArm"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.CanCollide = false
p.BrickColor = DC
p.Reflectance = MR
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.15, 1, 0.15)
m.Offset = Vector3.new(-0.09, -0.4 ,0.4)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 2.1, 0.05)
w.C1 = CFrame.new()
w.Parent = p--]]
local p = Instance.new("Part") --------------- ButtSpike
p.Material = "SmoothPlastic"
p.Name = "ButtSpike"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BrickColor.new("Black")
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("CylinderMesh")
m.Scale = Vector3.new(0.2, 0.6, 0.2)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0.5, -1.06) *
CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
w.C1 = CFrame.new()
w.Parent = p
else end
return model
end
function removeParts(format)
if format == "RightHand" then
pcall(function() Player.Character[Name]:Remove() end)
elseif format == "LeftHand" then
pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
elseif format == "RightHolster" then
pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
elseif format == "LeftHolster" then
pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove()
end)
end
end
if magazine.Value ~= 0 then
makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))
else end
wait(0.08)
for i = 1, 0, -0.25 do
if Player.Character:FindFirstChild("Torso") ~= nil then
if Player.Character.Torso:FindFirstChild("Right Shoulder
2") ~= nil then
Player.Character.Torso["Right Shoulder 2"].C0 =
CFrame.new()
Player.Character.Torso["Right Shoulder 2"].C1 =
CFrame.new(-1.2, 0 - (i / 1.5), 0.9) * CFrame.fromEulerAnglesXYZ(math.rad(-90),
math.rad(-5), 0)
wait()
else return false end
else return false end
end
Player.Character[Name].Bolt.Weld.C0 = CFrame.new(0, -0.2, 0.06)
wait(0.02)
removeParts("RightHand")
makeParts("RightHand")
playAnimation("hold")
return true
end
if format == "fire" then
coroutine.resume(coroutine.create(function()
Player.Character[Name].Trigger.Weld.C0 = CFrame.new(0, -0.08,
-0.25)
Player.Character[Name].Handle.Empty:Play()
wait(0.2)
Player.Character[Name].Trigger.Weld.C0 = CFrame.new(0, 0.02,
-0.25)
end))
if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
if silenced then
Player.Character[Name].Handle.Fire2.Volume = math.random(3,
8) / 10
Player.Character[Name].Handle.Fire2.Pitch = math.random(20,
25) / 10
Player.Character[Name].Handle.Fire2:Play()
CamShake(10, 2000)
else
Player.Character[Name].Handle.Fire.Volume = math.random(9,
10) / 10
Player.Character[Name].Handle.Fire:Play()
CamShake(10, 2000)
end
else return false end
if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
if silenced == false then
coroutine.resume(coroutine.create(function()
Player.Character[Name].Muzzle.Smoke.Enabled = true
Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1)
Player.Character[Name].Muzzle.Smoke.Enabled = false
Player.Character[Name].Muzzle.Fire.Enabled = false end))
else end
else return false end
for i = 0, 15, 5 do
if Player.Character:FindFirstChild("Torso") ~= nil then
if Player.Character.Torso:FindFirstChild("Left Shoulder 2")
~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
Player.Character.Torso["Left Shoulder 2"].C0 =
CFrame.new()
Player.Character.Torso["Left Shoulder 2"].C1 =
CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 +
i), math.rad(-90))
Player.Character.Torso["Right Shoulder 2"].C0 =
CFrame.new()
Player.Character.Torso["Right Shoulder 2"].C1 =
CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i),
math.rad(-5), 0)
wait()
else return false end
else return false end
end
for i = 15, 0, -5 do
if Player.Character:FindFirstChild("Torso") ~= nil then
if Player.Character.Torso:FindFirstChild("Left Shoulder 2")
~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
Player.Character.Torso["Left Shoulder 2"].C0 =
CFrame.new()
Player.Character.Torso["Left Shoulder 2"].C1 =
CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 +
i), math.rad(-90))
Player.Character.Torso["Right Shoulder 2"].C0 =
CFrame.new()
Player.Character.Torso["Right Shoulder 2"].C1 =
CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i),
math.rad(-5), 0)
wait()
else return false end
else return false end
end
end
return true
end
function makeShell(part)
if part == nil then return false end
local casing = Instance.new("Part")
casing.Name = "Shell"
casing.formFactor = "Custom"
casing.Size = Vector3.new(0.2, 0.28, 0.2)
casing.CFrame = CFrame.new(part.Position) *
CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0,
360)), math.rad(math.random(0, 360)))
casing.BrickColor = BrickColor.new("New Yeller")
local mesh = Instance.new("CylinderMesh")
mesh.Scale = Vector3.new(0.8, 1.4, 0.8)
mesh.Parent = casing
local s = Instance.new("Sound")
s.Name = "Ding"
s.SoundId = "http://www.roblox.com/Asset/?id=13114759"
s.Volume = 0.4
s.Pitch = 2.5
s.Looped = false
s.Parent = casing
casing.Parent = game:GetService("Workspace")
casing.Ding:Play()
casing:BreakJoints()
casing.Velocity = (part.CFrame.lookVector * 65) + Vector3.new(0, 10, 0)
coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do
casing.Transparency = i wait() end casing:Remove() end))
end
function Weld(x, y)
local weld = Instance.new("Weld")
weld.Part0 = x
weld.Part1 = y
CJ = CFrame.new(x.Position)
C0 = x.CFrame:inverse() * CJ
C1 = y.CFrame:inverse() * CJ
weld.C0 = C0
weld.C1 = C1
weld.Parent = x
end
function tagHumanoid(humanoid)
local tag = Instance.new("ObjectValue")
tag.Name = "creator"
tag.Value = Player
tag.Parent = humanoid
local tag = Instance.new("StringValue")
tag.Name = "creatorType1"
tag.Value = Name
tag.Parent = humanoid
local tag = Instance.new("StringValue")
tag.Name = "creatorType2"
tag.Value = "shot"
tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:FindFirstChild("creator")
if tag ~= nil then
tag:Remove()
end
local tag = humanoid:FindFirstChild("creatorType1")
if tag ~= nil then
tag:Remove()
end
local tag = humanoid:FindFirstChild("creatorType2")
if tag ~= nil then
tag:Remove()
end
end
end
else
Hit.Parent.Humanoid:TakeDamage(damage1)
damage1 = damage1 / 2
end
end
else end
else end
local trail = Instance.new("Part")
trail.Name = "Bullet Trail"
trail.BrickColor = BrickColor.new("Dark stone grey")
trail.TopSurface = 0
trail.BottomSurface = 0
trail.formFactor = 0
trail.Size = Vector3.new(1, 1, 1)
trail.Transparency = 0.5
trail.Anchored = true
trail.CanCollide = false
trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint)
trail.Parent = game:GetService("Workspace")
local mesh = Instance.new("SpecialMesh")
mesh.MeshType = "Brick"
mesh.Scale = Vector3.new(0.1, 0.1, (startPoint - endPoint).magnitude)
mesh.Parent = trail
coroutine.resume(coroutine.create(function(part) for i = 1, 10 do
part.Mesh.Scale = Vector3.new(part.Mesh.Scale.x - 0.01, part.Mesh.Scale.y - 0.01,
part.Mesh.Scale.z) wait() end part:Remove() end), trail)
if hit ~= nil then
if hit.Parent == nil then return end
if hit.Parent.ClassName == "Hat" then
if hit.Parent.Parent.Humanoid ~= nil then
hit.Parent.Parent.Humanoid:TakeDamage(damage * 5)
end
end
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
tagHumanoid(hit.Parent.Humanoid)
if hit.Name == "Head" then
hit.Parent.Humanoid:TakeDamage(damage1 * 10)
elseif hit.Name == "Torso" then
hit.Parent.Humanoid:TakeDamage(damage1 * 2)
elseif hit.Name == "Left Leg" then
hit.Parent.Humanoid:TakeDamage(damage1)
hit.Parent.Humanoid.Sit = true
elseif hit.Name == "Right Leg" then
hit.Parent.Humanoid:TakeDamage(damage1)
hit.Parent.Humanoid.Sit = true
else
hit.Parent.Humanoid:TakeDamage(damage1)
end
if math.random(1, 3) == 1 then
hit.Parent.Humanoid.Sit = true
end
delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end)
end
if hit.Anchored == false then
hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit *
(damage1 * 4))
end
end
end
function onButton1Down(mouse)
if selected == false then return end
if Player.Character:FindFirstChild(Name) ~= nil and Button1Down == false and
canFire == true and (function() if dual == true then if
Player.Character:FindFirstChild(Name.. " (Left)") ~= nil then return true else
return false end else return true end end)() == true then
if Player.Character[Name]:FindFirstChild("Handle") == nil then return
end
if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return
end
if dual == true then if Player.Character[Name.. "
(Left)"]:FindFirstChild("Handle") == nil then return end end
if dual == true then if Player.Character[Name.. "
(Left)"]:FindFirstChild("Muzzle") == nil then return end end
mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
Button1Down = true
canFire = false
canFire2 = true
while canFire2 == true do
local humanoid = Player.Character:FindFirstChild("Humanoid")
if humanoid == nil then
canFire2 = false
break
end
if humanoid.Health <= 0 then
canFire2 = false
break
end
local fireLeft = false
if automatic == false and burst == false then
canFire2 = false
elseif automatic == false and burst == true then
if burstCount >= burstCountMax then
canFire2 = false
burstCount = 0
break
end
burstCount = burstCount + 1
elseif automatic == true and burst == false then
fireLeft = true
end
if Chambered == true then
Chambered = false
fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p,
mouse.Target)
coroutine.resume(coroutine.create(function()
if dual == true then
playAnimation("rightFire")
elseif dual == false then
playAnimation("fire")
end
end))
else
Player.Character[Name].Handle.Empty:Play()
end
if fireLeft == true and dual == true and automatic == true then
if magazine.Value > 0 then
coroutine.resume(coroutine.create(function()
wait(readyTime / 2)
magazine.Value = magazine.Value - 1
updateGui()
fire(Player.Character[Name.. "
(Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
playAnimation("leftFire")
end))
else
coroutine.resume(coroutine.create(function()
wait(readyTime / 2)
Player.Character[Name].Handle.Empty:Play()
end))
end
end
end
canFire = true
mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
end
end
function onButton1Up(mouse)
if selected == false then return end
Button1Down = false
canFire2 = false
burstCount = 0
while canFire == false do wait() end
if dual == true and automatic == false then
if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil
then return end
if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil
then return end
mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
canFire = false
canFire2 = true
while canFire2 == true do
local humanoid = Player.Character:FindFirstChild("Humanoid")
if humanoid == nil then
canFire2 = false
break
end
if humanoid.Health <= 0 then
canFire2 = false
break
end
if burst == false then
canFire2 = false
elseif burst == true then
if burstCount >= burstCountMax then
canFire2 = false
burstCount = 0
break
end
burstCount = burstCount + 1
end
if magazine.Value <= 0 then
Player.Character[Name].Handle.Empty:Play()
else
coroutine.resume(coroutine.create(function()
playAnimation("leftFire")
end))
magazine.Value = magazine.Value - 1
updateGui()
fire(Player.Character[Name.. " (Left)"].Muzzle.Position,
mouse.Hit.p, mouse.Target)
end
wait(readyTime)
end
mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
canFire = true
end
end
Player.Character[Name].Muzzle.Name = "Silencer"
Player.Character[Name]["Muzzle 2"].Name = "Muzzle"
if dual == true then
if Player.Character[Name.. "
(Left)"]:FindFirstChild("Muzzle") == nil then return end
if Player.Character[Name.. "
(Left)"]:FindFirstChild("Muzzle 2") == nil then return end
Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1
Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer"
Player.Character[Name.. " (Left)"]["Muzzle 2"].Name =
"Muzzle"
end
else
silenced = true
if Player.Character:FindFirstChild(Name) == nil then return end
if Player.Character[Name]:FindFirstChild("Silencer") == nil then
return end
if Player.Character[Name]:FindFirstChild("Muzzle") == nil then
return end
Player.Character[Name].Silencer.Transparency = 0
Player.Character[Name].Silencer1.Transparency = 0
Player.Character[Name].Silencer2.Transparency = 0
canFire = true
end
end
end
function onSelected(mouse)
if selected == true then return end
selected = true
canFire = false
mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
if Player.Character.WeaponActivated.Value == nil then break end
if Player.Character.WeaponActivated.Value.Parent == nil then break end
wait()
end
updateGui()
local weapon = Instance.new("ObjectValue")
weapon.Name = "WeaponActivated"
weapon.Value = script.Parent
weapon.Parent = Player.Character
DisableLimb(1, Player.Character)
DisableLimb(2, Player.Character)
ForceAngle(1, 0, Player.Character)
ForceAngle(2, 0, Player.Character)
if dual == true then
coroutine.resume(coroutine.create(function() playAnimation("leftEquip")
end))
playAnimation("rightEquip")
removeParts("LeftHolster")
makeParts("LeftHand")
else
playAnimation("equip")
end
removeParts("RightHolster")
makeParts("RightHand")
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
canFire = true
end
function onDeselected(mouse)
if selected == false then return end
Button1Down = false
while canFire == false do
wait()
end
selected = false
if dual == true then
if math.random(1, 2) == 1 then
coroutine.resume(coroutine.create(function()
playAnimation("leftUnequip") end))
wait(math.random(1, 10) / 10)
playAnimation("rightUnequip")
else
coroutine.resume(coroutine.create(function()
playAnimation("rightUnequip") end))
wait(math.random(1, 10) / 10)
playAnimation("leftUnequip")
end
removeParts("LeftHand")
makeParts("LeftHolster")
else
playAnimation("unequip")
end
removeParts("RightHand")
makeParts("RightHolster")
ForceAngle(1, 0, Player.Character)
ForceAngle(2, 0, Player.Character)
ResetLimbCFrame(1, Player.Character)
ResetLimbCFrame(2, Player.Character)
EnableLimb(1, Player.Character)
EnableLimb(2, Player.Character)
if Player.PlayerGui:FindFirstChild(Name) ~= nil then
Player.PlayerGui[Name]:Remove() end
if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
if Player.Character.WeaponActivated.Value == script.Parent then
Player.Character.WeaponActivated:Remove()
end
end
while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
if Player.Character.WeaponActivated.Value == nil then break end
if Player.Character.WeaponActivated.Value.Parent == nil then break end
wait()
end
end
if script.Parent.ClassName ~= "HopperBin" then
if Player == nil then print("Error: Player not found!") return end
Tool = Instance.new("HopperBin")
Tool.Name = Name
Tool.Parent = Player.Backpack
script.Name = "Main"
script.Parent = Tool
end wait() if script.Parent.ClassName == "HopperBin" then
while script.Parent.Parent.ClassName ~= "Backpack" do
wait()
end
if script.Parent:FindFirstChild("MagazineMax") == nil then
magazineMax = Instance.new("NumberValue")
magazineMax.Name = "MagazineMax"
magazineMax.Value = 5
magazineMax.Parent = script.Parent
else
magazineMax = script.Parent.MagazineMax
end
if script.Parent:FindFirstChild("Magazine") == nil then
magazine = Instance.new("NumberValue")
magazine.Name = "Magazine"
magazine.Value = 0
magazine.Parent = script.Parent
else
magazine = script.Parent.Magazine
end
if script.Parent:FindFirstChild("AmmoMax") == nil then
ammoMax = Instance.new("NumberValue")
ammoMax.Name = "AmmoMax"
ammoMax.Value = 50
ammoMax.Parent = script.Parent
else
ammoMax = script.Parent.AmmoMax
end
if script.Parent:FindFirstChild("Ammo") == nil then
ammo = Instance.new("NumberValue")
ammo.Name = "Ammo"
ammo.Value = script.Parent.AmmoMax.Value
ammo.Parent = script.Parent
else
ammo = script.Parent.Ammo
end
Player = script.Parent.Parent.Parent
makeParts("RightHolster")
script.Parent.Selected:connect(onSelected)
script.Parent.Deselected:connect(onDeselected)
end