
You are being evaluated on Roblox game development in Luau. ...
Prompt
You are being evaluated on Roblox game development in Luau. Answer every item in order. Code must be complete, runnable, and idiomatic. Use current APIs only β if unsure whether an API still exists or is deprecated, say so explicitly instead of guessing. 1. Luau fluency: Write a typed Luau class using metatables (no external frameworks) for an Inventory: add/remove/stack items, max slots, serialization to/from a table for DataStore. Use Luau type annotations (export type, typed methods). 2. Client-server security: Build a shop system. Server Script + LocalScript + RemoteEvent. Player requests a purchase; the server must validate price, currency, distance to shopkeeper, and rate-limit requests. Explain in 3 sentences why each check must live server-side. 3. DataStores: Write a DataStore save/load module with pcall wrapping, retry with backoff, and protection against data loss on failed loads (don't overwrite good data with nil). Handle BindToClose. 4. Debugging: [paste a short script with 4β5 real bugs: one deprecated API, one client-side trust bug, one memory-leak connection, one off-by-one] Find and fix every bug, listing each. 5. Architecture: Refactor a 300-line single-script weapon system I paste into ModuleScripts with clean separation (shared config, server logic, client input). Explain your module boundaries. 6. API honesty: What is the current recommended way to store per-instance metadata β and what older pattern did it replace? If your knowledge might be stale, say so and state your cutoff. 7. Performance: This loop allocates a new table and calls Instance.new every frame for 500 projectiles. Rewrite it (pooling or equivalent) and explain the cost you removed.