Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Tommy Gun Problems with Reload

its the orginal script, and he took away some parts that had --[[ near them and he says that when he tries to reload he fails...

------------------------------------------Gun info
wait(1)
ToolName="Tommy Gun"
ClipSize=50
BaseDamage = 75
ROF = 0.1
Accuracy = 1
local gunSpecs = {
	bulletMass		= 5;
	bulletSpeed		= 550; -- studs/sec
}
local recoil = .05
local kick = .025

automatic = true
burst = false
shot = false

ReloadTime=0
MinSpread=0
MaxSpread=0.001
SpreadRate=0
Bulletdrop = 0.025
Tool = script.Parent
enabled = true
attaching = false
local vPlayer 
local Gui
local mem_camYaw = 0
local zoomdist = 110
local skateboardId = 65068906 
local arms = nil
local torso = nil
local weld33 = nil -- right arm
local weld55 = nil -- left arm
local welds = {}
holst = false
zooming = false
running = false
BarrlePos=Vector3.new(0,0,0)Cursors={"http://www.roblox.com/asset/?id=47894837"}
ReloadCursor="rbxasset://textures\\GunWaitCursor.png"

barrel_1  = script.Parent:findFirstChild("barrelpos1") or script.Parent.Handle
barrel_2 = script.Parent:findFirstChild("barrelpos2") or script.Parent.Handle

double = false	--Double Wielded 
doublemode = 1 -- 1 is alternating, 2 is both


-------------------------------------
Tool = script.Parent

p = Instance.new("Part")
p.Parent = game.Lighting
p.Name = "BulletTexture"
p.CanCollide = false
p.formFactor = "Custom"
p.Size = Vector3.new(1,0.1,1)
p.Transparency = 1
g = Instance.new("SpecialMesh")
g.Parent = p

run = 0 
equiped=false
dw = false
sp=script.Parent
RayLength=1000
Spread=15
enabled=true
reloading=false
down=false
r=game:service("RunService")
last=0
last2=0
last3=0
last4=0
last5=0
last6=0
UseDouble = false

Bullet=Instance.new("Part")
Bullet.Name="Bullet"
Bullet.BrickColor=BrickColor.new("New Yeller")
Bullet.Anchored=true
Bullet.CanCollide=false
Bullet.Locked=true
Bullet.Size=Vector3.new(1,1,1)
Bullet.Transparency=.45
Bullet.formFactor=0
Bullet.TopSurface=0
Bullet.BottomSurface=0
mesh=Instance.new("SpecialMesh")
mesh.Parent=Bullet
mesh.MeshType="Brick"
mesh.Name="Mesh"
mesh.Scale=Vector3.new(.15,.15,1)


function computeDirection(vec)
	return vec.unit
end

local legs = nil
local torso2 = nil
local welds2 = {}
local bodyforce = nil

function tagHumanoid(humanoid)
	local plr=game.Players:playerFromCharacter(sp.Parent)
	if plr~=nil then
		local tag=Instance.new("ObjectValue")
		tag.Value=plr
		tag.Name="creator"
		tag.Parent=humanoid
		delay(2,function()
			if tag~=nil then
				tag.Parent=nil
			end
		end)
	end
end


function ReloadSequence() 
if Tool.ZoomedIn.Value == true then
Tool.ZoomedIn.Value = false 
aimoff()
end
Tool.Mag.Transparency = 1
Tool.Mag2.Transparency = 1
Tool.Mag3.Transparency = 1
coroutine.resume(coroutine.create(function()
	for i = 1, 25 do
		local pitch = getPitchFromVector(camera.CoordinateFrame.lookVector)
	neck.C1 = CFrame.new(0,.75,0) * CFrame.Angles(pitch,0,0)
	wait(.05)
	end
	end))
weld33.C1 = CFrame.new(1, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), math.rad(-90))
wait(.05)
weld33.C1 = CFrame.new(0.9, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(10), math.rad(-85))
wait(.05)
weld33.C1 = CFrame.new(0.8, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(15), math.rad(-80))
wait(.05)
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), -.2, math.rad(-90))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), -.4, math.rad(-90))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), -.5, math.rad(-90))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, 1, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), -.8, math.rad(-80))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, .8, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), -1, math.rad(-70))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, .6, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), -1.2, math.rad(-60))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, .6, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), -1, math.rad(-60))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
Tool.Mag.Transparency = 0
Tool.Mag2.Transparency = 0
Tool.Mag.Mesh.Offset = Vector3.new(-0, -1, 0)
Tool.Mag2.Mesh.Offset = Vector3.new(0, -0.98, 0.175)
weld55.C1 = CFrame.new(0.95, .6, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), -.8, math.rad(-70))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
Tool.Mag.Mesh.Offset = Vector3.new(-0, -0.8, 0)
Tool.Mag2.Mesh.Offset = Vector3.new(0, -0.77, 0.142)

weld55.C1 = CFrame.new(0.95, .6, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0.5, math.rad(-75))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
Tool.Mag.Mesh.Offset = Vector3.new(-0, -0.6, 0)
Tool.Mag2.Mesh.Offset = Vector3.new(0, -0.59, 0.105)

weld55.C1 = CFrame.new(0.95, .6, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), -.4, math.rad(-75))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
Tool.Mag.Mesh.Offset = Vector3.new(-0, -0.4, 0)
Tool.Mag2.Mesh.Offset = Vector3.new(0, -0.39, 0.072)
weld55.C1 = CFrame.new(0.95, .6, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), -.2, math.rad(-75))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
Tool.Mag.Mesh.Offset = Vector3.new(-0, -0.2, 0)
Tool.Mag2.Mesh.Offset = Vector3.new(0, -0.197, 0.037)
weld55.C1 = CFrame.new(0.95, .6, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), -0, math.rad(-75))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
Tool.Mag.Mesh.Offset = Vector3.new(-0, 0, 0)
Tool.Mag2.Mesh.Offset = Vector3.new(0, 0, 0)
Tool.Mag3.Transparency = 0
weld55.C1 = CFrame.new(0.95, .5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), 0.2, math.rad(-75))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, .4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), 0.4, math.rad(-75))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, .5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), 0.2, math.rad(-80))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.95, .6, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), 0, math.rad(-85))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.925, .7, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(320), 0, math.rad(-90))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(20), math.rad(-75))
wait(.05)
weld55.C1 = CFrame.new(0.9, 0.8, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(320), 0, math.rad(-90))
weld33.C1 = CFrame.new(0.7, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(15), math.rad(-75))
wait(.05)
weld33.C1 = CFrame.new(0.8, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(10), math.rad(-80))
wait(.05)
weld33.C1 = CFrame.new(0.9, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), math.rad(-85))
wait(.05)
weld33.C1 = CFrame.new(1, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(0), math.rad(-90))
wait(.05)




end

1 answer

function reload(mouse)
if sp.Ammo.Value<ClipSize and enabled and mouse ~= nil then
	Tool.Running.Value = false
	reloading=true
	mouse.Icon=ReloadCursor
	Tool.Handle.Reload:Play()
	ReloadSequence()
		if reloading then
				if Tool.AmmoStored.Value <= ClipSize then 
				am = Tool.AmmoStored.Value
				Tool.Ammo.Value = am
				Tool.AmmoStored.Value = Tool.AmmoStored.Value - am
				else
				am2 = ClipSize - Tool.Ammo.Value
				Tool.Ammo.Value = ClipSize
				Tool.AmmoStored.Value = Tool.AmmoStored.Value - am2
				end
			check()
		end
	check()
	mouse.Icon=Cursors[1]
	reloading=false
end
end
thrown = true
VELOCITY = 50

function Nade2()
	local model = Instance.new("Model")
	model.Name = "Nade"
	model.Parent = game.Workspace
	nade = game.Lighting.Handle:clone()
	nade.Parent = model
	nade.CanCollide = true
	local script = Tool.NadeScript2:clone()
	script.Disabled = false
	script.Parent = nade
	return model
end

function onThrow2()
	if thrown == true then return end
	if script.Parent.Grenades.Value > 0 then
	thrown = true
	local character = Tool.Parent
	local humanoid = character.Humanoid
	if humanoid == nil then return end
	local targetPos = humanoid.TargetPoint
	lob2(targetPos)
	Tool.Grenades.Value = Tool.Grenades.Value - 1
	check()
	wait(5)
	thrown = false
	end
end

thrown = false

function lob2(mousepos)
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local head = Tool:findFirstChild("Handle")
	if head == nil then return end
	local dir = mousepos - head.Position
	dir = computeDirection2(dir)
	local launch = head.Position + 10 * dir	local delta = mousepos - launch
	local dy = delta.y
	local new_delta = Vector3.new(delta.x, 0, delta.z)
	delta = new_delta
	local dx = delta.magnitude
	local unit_delta = delta.unit
	local g = (-9.81 * 20)
	local theta = computeLaunchAngle(dx, dy, g)
	local vy = math.sin(theta)
	local xz = math.cos(theta)
	local vx = unit_delta.x * xz
	local vz = unit_delta.z * xz
	local missile = Nade2()
	missile.Handle.Position = launch
	missile.Handle.Velocity = Vector3.new(vx, vy, vz) * VELOCITY
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = vPlayer
	creator_tag.Name = "creator"
	creator_tag.Parent = missile.Handle
end

function computeLaunchAngle(dx, dy, grav)
	-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
	local g = math.abs(grav)
	local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
	if inRoot <= 0 then
		return .25 * math.pi
	end
	local root = math.sqrt(inRoot)
	local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)
	local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
	local answer1 = math.atan(inATan1)
	local answer2 = math.atan(inATan2)
	if answer1 < answer2 then return answer1 end
	return answer2
end

function computeDirection2(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end


function sprint()
running = true
if Tool.ZoomedIn.Value == true then
Tool.ZoomedIn.Value = false 
aimoff()
end

Tool.Parent.Humanoid.WalkSpeed = 20
weld55.C1 = CFrame.new(1, 0.8, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(320), 0, math.rad(-90))
weld33.C1 = CFrame.new(1, 0.2, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-0), math.rad(-90))
for i = 1, 10 do
wait()
l = 10 - i
weld55.C1 = CFrame.new(1-l*.03, 0.9+l*.01, 0.6+l*.02) * CFrame.fromEulerAnglesXYZ(math.rad(250+l*7), 0, math.rad(-120+l*3))
weld33.C1 = CFrame.new(1+l*.03, 0.1+l*.01, -1.1+l*.01) * CFrame.fromEulerAnglesXYZ(math.rad(-150+l*6),0, math.rad(-110+l*2))
end
wait()
running = false
end

function run()
running = true
for i = 1, 10 do
wait()
l = 10 - i
weld55.C1 = CFrame.new(0.7+l*.03, 0.8-l*.01, 0.8-l*.02) * CFrame.fromEulerAnglesXYZ(math.rad(320-l*7), 0, math.rad(-90-l*3))
weld33.C1 = CFrame.new(1.3-l*.03, 0.2-l*.01, -1-l*.01) * CFrame.fromEulerAnglesXYZ(math.rad(-90-l*6), math.rad(-0), math.rad(-90-l*2))
end
Tool.Parent.Humanoid.WalkSpeed = 16
Tool.Running.Value = false
running = false
end


function attach()

	weld1.Part0 = torso
	weld2.Part0 = torso
	
	wait(0.1)

	Tool.GripUp = Vector3.new(1, 0, -0)

	weld33.C1 = CFrame.new(-0.35, 1.1, .9) * CFrame.fromEulerAnglesXYZ(math.rad(292), math.rad(2), math.rad(-92))
	weld55.C1 = CFrame.new(-0.75, 0.45, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-92), math.rad(-7), math.rad(-0))
	wait()

Tool.GripUp = Vector3.new(1, 0, -0.1)

	weld33.C1 = CFrame.new(-0.25, 0.9, .9) * CFrame.fromEulerAnglesXYZ(math.rad(294), math.rad(4), math.rad(-94))
	weld55.C1 = CFrame.new(-0.75, 0.55, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-94), math.rad(-7), math.rad(-0))
	wait()

Tool.GripUp = Vector3.new(1, 0, -0.2)

	weld33.C1 = CFrame.new(-0.15, 0.8, .9) * CFrame.fromEulerAnglesXYZ(math.rad(296), math.rad(6), math.rad(-96))
	weld55.C1 = CFrame.new(-0.75, 0.65, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-96), math.rad(-7), math.rad(-0))
	wait()

Tool.GripUp = Vector3.new(1, 0, -0.2)

	weld33.C1 = CFrame.new(-0.05, 0.6, .9) * CFrame.fromEulerAnglesXYZ(math.rad(296), math.rad(8), math.rad(-98))
	weld55.C1 = CFrame.new(-0.75, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-98), math.rad(-7), math.rad(-0))
	wait()

	weld33.C1 = CFrame.new(-0.05, 0.4, .9) * CFrame.fromEulerAnglesXYZ(math.rad(298), math.rad(10), math.rad(-100))
	weld55.C1 = CFrame.new(-0.75, 0.85, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(-7), math.rad(-0))
	wait()

	weld33.C1 = CFrame.new(-0.05, 0.2, .9) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(12), math.rad(-100))
	weld55.C1 = CFrame.new(-0.75, 0.95, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(-7), math.rad(-0))
	wait()

	weld33.C1 = CFrame.new(-0.05, 0, .9) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(12), math.rad(-100))
	weld55.C1 = CFrame.new(-0.75, 1.05, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(-7), math.rad(-0))
	wait()


	weld33.C1 = CFrame.new(-0.05, -0.1, .9) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(14), math.rad(-100))
	weld55.C1 = CFrame.new(-0.75, 1.15, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(-7), math.rad(-0))
	wait()

	weld33.C1 = CFrame.new(-0.05, -0.1, .9) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(15), math.rad(-100))
	weld55.C1 = CFrame.new(-0.75, 1.15, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(-7), math.rad(-0))
	wait()

--bayonet gripped
	weld33.C1 = CFrame.new(-0.05, -0.1, 0.9) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(15), math.rad(-100))
	weld55.C1 = CFrame.new(-0.75, 1.15, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(-7), math.rad(-0))
	wait(0.1)


	weld33.C1 = CFrame.new(-0.05, -0.3, 0.9) * CFrame.fromEulerAnglesXYZ(math.rad(304), math.rad(15), math.rad(-100))
	weld55.C1 = CFrame.new(-0.75, 1.6, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-95), math.rad(0), math.rad(-0))
	wait(0.1)


	weld33.C1 = CFrame.new(-0.05, -0.5, 0.9) * CFrame.fromEulerAnglesXYZ(math.rad(304), math.rad(15), math.rad(-100))
	weld55.C1 = CFrame.new(-0.75, 1.8, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(3), math.rad(-0))
	wait(0.1)

	Tool.GripUp = Vector3.new(1, 0, -0.2)

	weld33.C1 = CFrame.new(-0.15, -0.3, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(302), math.rad(13), math.rad(-98))
	weld55.C1 = CFrame.new(-0.75, 1.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-98), math.rad(0), math.rad(-0))
	wait()

Tool.GripUp = Vector3.new(1, 0, -0.1)

	weld33.C1 = CFrame.new(-0.25, -0.1, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-96))
	weld55.C1 = CFrame.new(-0.75, 1.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-96), math.rad(-3), math.rad(-0))
	wait()

Tool.GripUp = Vector3.new(1, 0, -0)

	weld33.C1 = CFrame.new(-0.35, 0.1, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(298), math.rad(8), math.rad(-94))
	weld55.C1 = CFrame.new(-0.75, 1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-94), math.rad(-5), math.rad(-0))
	wait()

Tool.GripUp = Vector3.new(1, 0, 0)

	weld33.C1 = CFrame.new(-0.45, 0.3, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(296), math.rad(6), math.rad(-92))
	weld55.C1 = CFrame.new(-0.75, 0.8, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-92), math.rad(-7), math.rad(-0))
	wait()

	weld33.C1 = CFrame.new(-0.45, 0.5, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(294), math.rad(4), math.rad(-90))
	weld55.C1 = CFrame.new(-0.75, 0.6, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-7), math.rad(-0))
	wait()

	weld33.C1 = CFrame.new(-0.45, 0.7, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(292), math.rad(2), math.rad(-90))
	weld55.C1 = CFrame.new(-0.75, 0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-7), math.rad(-0))
	wait()

	weld33.C1 = CFrame.new(-0.45, 0.8, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(290), math.rad(0), math.rad(-90))
	weld55.C1 = CFrame.new(-0.75, 0.25, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-7), math.rad(-0))
	wait()

	weld33.C1 = CFrame.new(-0.45, 1.0, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(290), math.rad(0), math.rad(-90))
	wait()

	weld33.C1 = CFrame.new(-0.45, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(290), math.rad(0), math.rad(-90))
	wait()

	weld33.C1 = CFrame.new(-0.45, 1.3, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(290), math.rad(0), math.rad(-90))
	wait()
	weld1.Part0 = mainPart
	weld2.Part0 = mainPart
end

function onKeyDown(key,mouse)
	key=key:lower()
	if key=="r" and not reloading and attaching == false then
		if sp.Ammo.Value < ClipSize and sp.AmmoStored.Value ~= 0 then
		reload(mouse)
		end
	end

	if key == "f" and not reloading then
	if Tool.FireMode.Value < 0 then
	Tool.FireMode.Value = Tool.FireMode.Value + 1
	else
	Tool.FireMode.Value = 1
	end
	end

1 comment

0

if key == "q" and not reloading then if Tool.ZoomedIn.Value == false and reloading == false and Tool.Running.Value == false and holst == false and running == false and attaching == false then zooming = true aimtest() elseif Tool.ZoomedIn.Value == true and reloading == false and Tool.Running.Value == false and holst == false and running == false and attaching == false then zooming = true

This discussion is preserved as it was. New answers, comments, and votes are closed.