-- 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. -- Lua Average Calculator: mean of a validated numeric sample local function average(values) assert(#values > 0, "provide at least one value") local total = 0 for _, value in ipairs(values) do assert(type(value) == "number", "all values must be numbers") total = total + value end return total / #values end print("Average:", average({ 12, 15, 18, 15 }))