“…but then i read somewhere that British fighting the scots using muskets could be defeated by charges of men with swords until the bayonette came about…”
The original tactics for fighting with the bayonet was to handle the weapon like a short pike or spear<1>, the weapon being used at shoulder height with one hand on the butt of the musket (remember that in the 1740s, most European armies were not long away from pike, some may still have had them). In these circumstances, a higlander armed with a sword and target (or in the case of many of the “front rank” highlanders sword, target, dirk and a dag or two) would have a distinct advantage.
It took a re-inforcement of discipline and a change in tactics to beat this. The new tactic meant learning to trust the man on your left such that, instead of tackling the man to your front you, as a line soldier, would attack the enemy to your right front, as, his defence (target) is to his left and front and his right flank is moderately undefended and open to attack, but you must be able to trust that the man to your left will do the same for you.
I believe that, what we consider “more conventional” bayonet usage developed (at least in Britain) in the period between 1746 and the 1770s.
<1> The earliest (plug) bayonets actually fitted into the muzzle of the musket redering it unusable, it took the invention of the socket bayonet to allow the musket to be used with the bayonet fitted.