|
shooter script
Tool = script.Parent
local arms = nil
local torso = nil
local weld33 = nil -- right arm
local weld55 = nil -- left arm
local welds = {}
local reloading = false
local canreload = true
local canshoot = true
local damage = 200
function ReloadSequence()
weld33.C1 = CFrame.new(-0.95, 0.1, 0.45) * CFrame.fromEulerAnglesXYZ(math.rad(-93), math.rad(-25), 0.1)
weld55.C1 = CFrame.new(-0.23, 0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(324), -0.2, math.rad(-85))
Tool.Handle.M1:play()
Tool.Mag.Transparency = 1
local mag = Tool.Mag:clone()
mag.Parent = game.Workspace
mag.CanCollide = false
mag.Transparency = 0
Tool.Mag2.Transparency = 1
local mag = Tool.Mag2:clone()
mag.Parent = game.Workspace
mag.CanCollide = false
mag.Transparency = 0
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.55) * CFrame.fromEulerAnglesXYZ(math.rad(-96), math.rad(-25), 0.2)
weld55.C1 = CFrame.new(-0.21, 0, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(328), -0.3, math.rad(-80))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-99), math.rad(-25), 0.3)
weld55.C1 = CFrame.new(-0.19, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(332), -0.4, math.rad(-75))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-100.5), math.rad(-25), 0.35)
weld55.C1 = CFrame.new(-0.17, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(336), -0.5, math.rad(-70))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-102), math.rad(-25), 0.4)
weld55.C1 = CFrame.new(-0.15, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(340), -0.6, math.rad(-65))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-104.5), math.rad(-25), 0.45)
weld55.C1 = CFrame.new(-0.13, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.7, math.rad(-60))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-106), math.rad(-25), 0.5)
weld55.C1 = CFrame.new(-0.11, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(348), -0.8, math.rad(-55))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-107.5), math.rad(-25), 0.55)--raise part
weld55.C1 = CFrame.new(-0.11, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(348), -0.9, math.rad(-50))
wait(.12)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.12, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.8, math.rad(-55))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.75, 0)
Tool.Mag.Transparency = 0
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.1), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.14, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.7, math.rad(-60))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.7, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.2), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.16, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.6, math.rad(-65))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.65, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.3), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.18, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.5, math.rad(-70))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.6, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.4), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.4, math.rad(-75))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.55, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.5), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.22, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.3, math.rad(-80))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.5, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.6), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.24, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.2, math.rad(-85))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.45, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.7), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.26, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.1, math.rad(-90))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.4, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-107.85), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.13, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.05, math.rad(-90))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.2, 0)
Tool.Handle.M2:play()
wait(.12)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-107), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, 0, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), 0, math.rad(-90))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.57) * CFrame.fromEulerAnglesXYZ(math.rad(-102), math.rad(-25), 0.42)
weld55.C1 = CFrame.new(-0.14, 0.05, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(338), -0.025, math.rad(-90))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.49) * CFrame.fromEulerAnglesXYZ(math.rad(-98), math.rad(-25), 0.29)
weld55.C1 = CFrame.new(-0.17, 0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(332), -0.05, math.rad(-90))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.41) * CFrame.fromEulerAnglesXYZ(math.rad(-94), math.rad(-25), 0.16)
weld55.C1 = CFrame.new(-0.20, 0.15, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(326), -0.075, math.rad(-90))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-25), 0)
weld55.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0.1, math.rad(-90))
end
function ReloadSequence2()
weld33.C1 = CFrame.new(-0.95, 0.1, 0.45) * CFrame.fromEulerAnglesXYZ(math.rad(-93), math.rad(-25), 0.1)
weld55.C1 = CFrame.new(-0.23, 0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(324), -0.2, math.rad(-85))
Tool.Handle.M1:play()
Tool.Mag.Transparency = 1
local mag = Tool.Mag:clone()
mag.Parent = game.Workspace
mag.CanCollide = false
mag.Transparency = 0
Tool.Mag2.Transparency = 1
local mag = Tool.Mag2:clone()
mag.Parent = game.Workspace
mag.CanCollide = false
mag.Transparency = 0
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.55) * CFrame.fromEulerAnglesXYZ(math.rad(-96), math.rad(-25), 0.2)
weld55.C1 = CFrame.new(-0.21, 0, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(328), -0.3, math.rad(-80))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-99), math.rad(-25), 0.3)
weld55.C1 = CFrame.new(-0.19, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(332), -0.4, math.rad(-75))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-100.5), math.rad(-25), 0.35)
weld55.C1 = CFrame.new(-0.17, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(336), -0.5, math.rad(-70))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-102), math.rad(-25), 0.4)
weld55.C1 = CFrame.new(-0.15, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(340), -0.6, math.rad(-65))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-104.5), math.rad(-25), 0.45)
weld55.C1 = CFrame.new(-0.13, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.7, math.rad(-60))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-106), math.rad(-25), 0.5)
weld55.C1 = CFrame.new(-0.11, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(348), -0.8, math.rad(-55))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-107.5), math.rad(-25), 0.55)--raise part
weld55.C1 = CFrame.new(-0.11, -0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(348), -0.9, math.rad(-50))
wait(.12)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.12, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.8, math.rad(-55))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.75, 0)
Tool.Mag.Transparency = 0
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.1), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.14, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.7, math.rad(-60))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.7, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.2), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.16, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.6, math.rad(-65))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.65, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.3), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.18, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.5, math.rad(-70))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.6, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.4), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.4, math.rad(-75))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.55, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.5), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.22, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.3, math.rad(-80))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.5, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.6), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.24, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.2, math.rad(-85))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.45, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-108.7), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.26, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.1, math.rad(-90))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.4, 0)
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-107.85), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, -0.13, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), -0.05, math.rad(-90))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0.2, 0)
Tool.Handle.M2:play()
wait(.12)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.65) * CFrame.fromEulerAnglesXYZ(math.rad(-107), math.rad(-25), 0.55)
weld55.C1 = CFrame.new(-0.11, 0, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(344), 0, math.rad(-90))
Tool.Mag.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.Mag2.Transparency = 0
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.57) * CFrame.fromEulerAnglesXYZ(math.rad(-102), math.rad(-25), 0.42)
weld55.C1 = CFrame.new(-0.14, 0.05, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(338), -0.025, math.rad(-90))
Slide1()
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.49) * CFrame.fromEulerAnglesXYZ(math.rad(-98), math.rad(-25), 0.29)
weld55.C1 = CFrame.new(-0.17, 0.1, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(332), -0.05, math.rad(-90))
Slide3()
Tool.Handle.M3:play()
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.41) * CFrame.fromEulerAnglesXYZ(math.rad(-94), math.rad(-25), 0.16)
weld55.C1 = CFrame.new(-0.20, 0.15, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(326), -0.075, math.rad(-90))
wait(.05)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-25), 0)
weld55.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0.1, math.rad(-90))
end
function Reload()
Tool.Left.Value = Tool.Ammo.Value
if script.Parent.Ammo.Value = 1 and canreload == true then
reloading = true
script.Parent.Ammo.Value = 0
ReloadChoose()
script.Parent.StoredAmmo.Value = script.Parent.StoredAmmo.Value + script.Parent.Left.Value
if script.Parent.StoredAmmo.Value >= script.Parent.MaxAmmo.Value then
script.Parent.StoredAmmo.Value = script.Parent.StoredAmmo.Value - script.Parent.MaxAmmo.Value
script.Parent.Ammo.Value = script.Parent.MaxAmmo.Value
script.Parent.Recoil.Value = 5
elseif script.Parent.StoredAmmo.Value = 1 then
script.Parent.Ammo.Value = script.Parent.StoredAmmo.Value
script.Parent.StoredAmmo.Value = 0
script.Parent.Recoil.Value = 5
end
reloading = false
end
end
function ReloadChoose()
if script.Parent.Left.Value == 0 then
ReloadSequence2()
elseif script.Parent.Left.Value >= 1 then
ReloadSequence()
end
end
function Slider()
if script.Parent.Ammo.Value == 0 then
Slide2()
elseif script.Parent.Ammo.Value >= 1 then
Slide3()
end
end
function Slider2()
if script.Parent.Ammo.Value == 0 then
Slide2()
Tool.Handle.Empty:play()
elseif script.Parent.Ammo.Value >= 1 then
Slide3()
end
end
function Slide1()
Tool.A1.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A2.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A3.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A4.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A5.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A6.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A7.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A8.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A9.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A10.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A11.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A12.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A13.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A14.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A15.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A16.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A17.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A18.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A19.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A20.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A21.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A22.Mesh.Offset = Vector3.new(0, 0, 0.18)
Tool.A23.Mesh.Offset = Vector3.new(0, 0.18, 0)
Tool.A24.Mesh.Offset = Vector3.new(0, 0.18, 0)
Tool.A25.Mesh.Offset = Vector3.new(0, 0.18, 0)
Tool.A26.Mesh.Offset = Vector3.new(0.18, 0, 0)
end
function Slide2()
Tool.A1.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A2.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A3.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A4.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A5.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A6.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A7.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A8.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A9.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A10.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A11.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A12.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A13.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A14.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A15.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A16.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A17.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A18.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A19.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A20.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A21.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A22.Mesh.Offset = Vector3.new(0, 0, 0.36)
Tool.A23.Mesh.Offset = Vector3.new(0, 0.36, 0)
Tool.A24.Mesh.Offset = Vector3.new(0, 0.36, 0)
Tool.A25.Mesh.Offset = Vector3.new(0, 0.36, 0)
Tool.A26.Mesh.Offset = Vector3.new(0.36, 0, 0)
end
function Slide3()
Tool.A1.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A2.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A3.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A4.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A5.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A6.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A7.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A8.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A9.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A10.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A11.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A12.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A13.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A14.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A15.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A16.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A17.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A18.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A19.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A20.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A21.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A22.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A23.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A24.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A25.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.A26.Mesh.Offset = Vector3.new(0, 0, 0)
end
function Takeout()
local canreload = false
local canshoot = false
weld33.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-78), math.rad(-25), 0)
weld55.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0.3, math.rad(-90))
wait(.03)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-82), math.rad(-25), 0)
weld55.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0.2, math.rad(-90))
wait(.03)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-86), math.rad(-25), 0)
weld55.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0.1, math.rad(-90))
wait(.03)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-25), 0)
weld55.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), 0, math.rad(-90))
wait(.03)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-25), 0)
weld55.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0.1, math.rad(-90))
local canreload = true
local canshoot = true
end
function Equip(mouse)
wait(0.01)
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = nil
sh[2].Part1 = nil
falsearm1 = arms[1]:clone()
local mesh1 = Tool.Larm:clone()
mesh1.Parent = falsearm1
local armweld1 = Instance.new("Weld")
falsearm1.BrickColor = BrickColor.new("Light orange")
falsearm1.Parent = Tool
armweld1.Parent = falsearm1
armweld1.Part0 = falsearm1
armweld1.Part1 = arms[1]
falsearm2 = arms[2]:clone()
local mesh2 = Tool.Rarm:clone()
mesh2.Parent = falsearm2
local armweld2 = Instance.new("Weld")
falsearm2.BrickColor = BrickColor.new("Light orange")
falsearm2.Parent = Tool
armweld2.Parent = falsearm2
armweld2.Part0 = falsearm2
armweld2.Part1 = arms[2]
local weld1 = Instance.new("Weld") -- left arm
weld55 = weld1
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), -1, math.rad(-90))
welds[1] = weld1
local weld2 = Instance.new("Weld") -- right arm
weld33 = weld2
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-76), math.rad(-25), 0)
welds[2] = weld2
Takeout()
end
else
print("sh")
end
else
print("arms")
end
end
local legs = nil
local torso2 = nil
local welds2 = {}
local bodyforce = nil
function Unequip(mouse)
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
welds[1].Parent = nil
welds[2].Parent = nil
falsearm1:remove()
falsearm2:remove()
end
else
print("sh")
end
else
print("arms")
end
end
function fire(v)
Tool.Handle.Fire:play()
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local missile = Instance.new("Part")
local spawnPos = vCharacter.PrimaryPart.Position
spawnPos = spawnPos + (v * 1)
missile.Position = spawnPos
missile.Size = Vector3.new(1,1,1)
missile.Velocity = v * 800
missile.BrickColor = BrickColor.new(26)
missile.Shape = 0
missile.BottomSurface = 0
missile.TopSurface = 0
missile.Name = "Bullet"
missile.Elasticity = 0
missile.Reflectance = 0
missile.Friction = .9
missile.CanCollide = false
local force = Instance.new("BodyForce")
force.force = Vector3.new(0,missile:getMass() * 196,0)
force.Parent = missile
local mesh = Instance.new("SpecialMesh")
mesh.Scale = Vector3.new(.01,.01,.01)
mesh.MeshType = "Sphere"
mesh.Parent = missile
local new_script = script.Parent.Bullet:clone()
new_script.Disabled = false
new_script.Parent = missile
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = vPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile
missile.Parent = game.Workspace
cam = game.Workspace.CurrentCamera
local cam_rot = cam.CoordinateFrame - cam.CoordinateFrame.p
local cam_scroll = (cam.CoordinateFrame.p - cam.Focus.p).magnitude
local ncf = CFrame.new(cam.Focus.p)*cam_rot*CFrame.fromEulerAnglesXYZ(0.012, -0.011, 0)
cam.CoordinateFrame = ncf*CFrame.new(0, 0, cam_scroll)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-92), math.rad(-25), 0)
weld55.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0.05, math.rad(-90))
Tool.Flash.Mesh.Scale = Vector3.new(1.462, 1.7, 1.462)
Tool.Flash.Transparency = .5
Slide2()
canreload = false
wait(.03)
local cam_rot = cam.CoordinateFrame - cam.CoordinateFrame.p
local cam_scroll = (cam.CoordinateFrame.p - cam.Focus.p).magnitude
local ncf = CFrame.new(cam.Focus.p)*cam_rot*CFrame.fromEulerAnglesXYZ(0.013, -0.013, 0)
cam.CoordinateFrame = ncf*CFrame.new(0, 0, cam_scroll)
weld33.C1 = CFrame.new(-0.95, 0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-25), 0)
weld55.C1 = CFrame.new(-0.25, 0.2, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0.1, math.rad(-90))
Tool.Flash.Transparency = 1
Slider2()
canreload = true
end
function KeyDownFunctions(key)
if key == "r" then
Reload()
end
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local ammo = script.Parent.Ammo
local maxammo = script.Parent.MaxAmmo
firing = true
while firing == true do
wait()
if reloading == false and humanoid.Health >= 1 then
if ammo.Value >= 1 then
ammo.Value = ammo.Value - 1
local targetPos = humanoid.TargetPoint
local lookAt = (targetPos - character.Head.Position).unit
if script.Parent.Recoil.Value < 2 then
script.Parent.Recoil.Value = script.Parent.Recoil.Value + 1
end
fire(lookAt)
else
Reload()
break
end
elseif reloading == false and humanoid.Health < 1 then
Tool:remove()
end
end
Tool.Enabled = true
end
function nofiar(mouse)
firing = false
end
function onEquippedLocal(mouse)
if mouse == nil then
print("Mouse not found")
return
end
mouse.Icon = "http://www.roblox.com/asset/?id=49912389"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() nofiar(mouse) end)
mouse.KeyDown:connect(KeyDownFunctions)
while true do
wait()
end
end
Tool.Equipped:connect(onEquippedLocal) |