I get bad argument #2 to '?' (Vector3 expected, got nil) as an error for this script.
function CreateBullet(Direction)
local Origin = GunModel.Barrel.CFrame.p
local BulletMass = BulletSize.X * BulletSize.Y * BulletSize.Z
local BulletCF = CF(Origin, Origin + Direction)
local Bullet = Instance.new("Part")
Bullet.BrickColor = BulletColor
Bullet.Name = "Bullet"
Bullet.CanCollide = false
Bullet.FormFactor = "Custom"
Bullet.Size = BulletSize
Bullet.BottomSurface = "Smooth"
Bullet.TopSurface = "Smooth"
local Mesh = Instance.new("BlockMesh")
Mesh.Scale = BulletMeshSize
Mesh.Parent = Bullet
local BF = Instance.new("BodyForce")
BF.force = Vector3.new(0, BulletMass * (196.2 - BulletDropPerSecond), 0)
BF.Parent = Bullet
Bullet.Parent = Gun
Bullet.CFrame = BulletCF + Direction * 3
Bullet.Velocity = Direction * BulletVelocity
end
Mouse.Button1Down:connect(CreateBullet)

3 comments
what line is the error on??
Line 04
NinjoOnline ^