Organise your project
Separate server authority, client presentation and shared modules.
Give each script a clear home#
Put authoritative game logic in ServerScriptService, shared modules in ReplicatedStorage and client presentation in StarterPlayerScripts or StarterGui. ReplicatedStorage is visible to clients; do not put secrets there.
- ServerScriptService/EconomyService: prices, rewards and purchase checks.
- ReplicatedStorage/Shared/ItemConfig: public item definitions.
- StarterPlayer/StarterPlayerScripts/ShopController: UI and input.
Keep systems small#
A module should have a defined responsibility and explicit interface. Pass dependencies to a module; avoid searching for unrelated global state. Centralise configuration values so that design changes don’t mean editing multiple scripts.
Paths in BLOXG AI#
Use service-relative paths with no .lua extension. Each file has an explicit script type. The editor rejects duplicate paths, unsupported roots and a script being used as a parent folder. Renaming a path does not rewrite references in other source files; use project search to do that.