function createBullet(g)local X=Gun.Main.CFrame.p local m=CF(X,X+g)local f=Instance.new("\080\097\114\116")f.BrickColor=S.bulletSettings.Color f.Material=Enum.Material.Neon f.Name="\066\117\108\108\101\116"f.CanCollide=false f.FormFactor="\067\117\115\116\111\109"f.Size=S.bulletSettings.Size f.BottomSurface="\083\109\111\111\116\104"f.TopSurface="\083\109\111\111\116\104"if math.min(S.bulletSettings.Size.X,S.bulletSettings.Size.Y,S.bulletSettings.Size.Z)<.2 then local g=Instance.new("\066\108\111\099\107\077\101\115\104")g.Scale=S.bulletSettings.Size/Vector3.new(math.max(S.bulletSettings.Size.X,.2),math.max(S.bulletSettings.Size.Y,.2),math.max(S.bulletSettings.Size.Z,.2))g.Parent=f end local E=Instance.new("\066\111\100\121\070\111\114\099\101")E.force=V3(0,f:GetMass()*(196.2-S.bulletSettings.Acceleration),0)E.Parent=f f.Parent=gunIgnore f.CFrame=m+(g*S.bulletSettings.Size.Z)/2 f.Velocity=g*S.bulletSettings.Velocity return f end


function createBullet(Direction)
	local Origin = Gun.Main.CFrame.p
	local bulletCF = CF(Origin, Origin + Direction)
	local Bullet = Instance.new("Part")
	Bullet.BrickColor = S.bulletSettings.Color
	Bullet.Material = Enum.Material.Neon
	Bullet.Name = "Bullet"
	Bullet.CanCollide = false
	Bullet.FormFactor = "Custom"
	Bullet.Size = S.bulletSettings.Size
	Bullet.BottomSurface = "Smooth"
	Bullet.TopSurface = "Smooth"
	if math.min(S.bulletSettings.Size.X, S.bulletSettings.Size.Y, S.bulletSettings.Size.Z) < 0.2 then
		local Mesh = Instance.new("BlockMesh")
		Mesh.Scale = S.bulletSettings.Size / Vector3.new(
			math.max(S.bulletSettings.Size.X, 0.2),
			math.max(S.bulletSettings.Size.Y, 0.2),
			math.max(S.bulletSettings.Size.Z, 0.2)
		)
		Mesh.Parent = Bullet
	end
	local BF = Instance.new("BodyForce")
	BF.force = V3(0, Bullet:GetMass() * (196.2 - S.bulletSettings.Acceleration), 0)
	BF.Parent = Bullet
	Bullet.Parent = gunIgnore
	Bullet.CFrame = bulletCF + Direction * S.bulletSettings.Size.Z / 2
	Bullet.Velocity = Direction * S.bulletSettings.Velocity
	return Bullet
end
