Assemble the buy button, the server's checkout counter, idle income, and the live UI updates from shuffled lines.
The shop is the whole security lesson in four scripts: the client asks, the server checks the bill, income flows on a timer, and the UI mirrors whatever the server recorded. Assemble each from shuffled lines — and keep the imposters out.
The button reports intent — never a price. Assemble its click handler.
The server rejects what it doesn't know, prices the upgrade, and checks the wallet before spending. Order matters.
Coins without clicking: a loop that pays everyone each second, guarded so new players don't crash it.
The shop panel is a mirror — it reflects whatever the server actually recorded. Assemble the receive handler.
Buy button → intent up → server checks the bill → spends → server sends the truth down → UI reflects it. Idle income feeds the same wallet, and the same UI shows it. If you can order these four pieces, you've got a complete, secure economy.
Why does the client never send a price to the server?