-- ScriptsCodes | Roblox Studio Luau utility -- Run: Open your own place in Roblox Studio, choose View > Command Bar, paste this file, and press Enter. -- Output: Results appear in the Studio Output window. Edit the sample values before running. -- Server-side validation pattern for a purchase request local function canPurchase(balance, price) return type(balance) == "number" and type(price) == "number" and price >= 0 and balance >= price end local balance, price = 100, 35 if canPurchase(balance, price) then balance -= price print("Purchase accepted; new balance:", balance) else warn("Purchase rejected") end