Only when written 投石器
Specifically refers to a hand-held sling or slingshot for throwing stones. This sense is restricted to the kanji form 投石器.
このゲームでは投石機で敵の壁を破壊できる。
In this game, you can destroy enemy walls with a catapult.
Ancient soldiers hurled stones with slings.
When I was a child, I made a slingshot and played with it.
General term for stone-throwing siege engines; covers catapults, ballistae, trebuchets, etc.
Also used for catapults and similar devices; specifically used for slings and slingshots (sense 2).
A compound of 投石 “stone throwing” and 機 “machine, device,” used broadly for machines or devices that launch stones or similar projectiles.