while wait()do
	local ammo = script.Ammo
	local mousePosition = script.MousePosition
	wait(.5)
	if script.Ammo.Value > 0 then
		local bullet = Instance.new("Part", workspace)
		bullet.Size = Vector3.new(4, 0.05, 0.05)
		bullet.Anchored = true
		local plr = script.Parent.Parent.Parent.Name
		bullet.Orientation = script.Parent.MainShootPart.Orientation
		bullet.Position = script.Parent.MainShootPart.Position
		local CFrame1 = bullet.CFrame
		local CFrame2 = script.MousePosition
		
		for i = 0,100,1 do
			bullet.CFrame = CFrame1:lerp(CFrame2,i/200)
			wait()
		end
	end
end

2 comments

0

Could you give more description on this, like which line it says the error, and go more in depth?

0

What is script.MousePosition? If it's a CFrameValue you'll have to take the actual Value of it.