In short
Luau saw a digit and read on to the end of the "word", and the result is not a number it knows: a number with letters straight after it (16studs), a name that starts with a digit (2ndPlace), or more than one decimal point (0.5.1). The script does not run until that word is fixed. The message names the line; look for the word that starts with a digit.
What the message means
ServerScriptService.Settings:2: Malformed number
Valid numbers in Luau look like 16, 0.5, 1e3, 0xFF, 0b1010 and 1_000_000 (underscores are allowed to group digits). Anything else that starts with a digit is malformed.
Commas are not part of numbers either: local price = 1,000 is not an error, but it sets price to 1 and throws the 000 away, which is worse because nothing warns you.
Causes and fixes
Three things cause this error in practice. Each one below has the smallest code that triggers it, then the fix.
- A unit or letters straight after a number
- A variable or name that starts with a digit
- Two decimal points, or a missing comma between numbers
A unit or letters straight after a number
Writing what the number means, such as studs, seconds or a percent sign, next to it turns the whole thing into one malformed word.
local SPRINT_SPEED = 24studs
local COOLDOWN = 2s
print(SPRINT_SPEED, COOLDOWN)
Keep only the number, and put the unit in the name or a comment.
local SPRINT_SPEED = 24 -- studs per second
local COOLDOWN_SECONDS = 2
print(SPRINT_SPEED, COOLDOWN_SECONDS)
A variable or name that starts with a digit
Names may contain digits but cannot start with one, so 2ndPlace is read as a number. The same happens when you refer to a part named 1stFloor with a dot.
local winners = { "Ana", "Ben" }
local first = winners[1]
print(first, 2ndPlace)
Rename variables so they start with a letter or an underscore. For an object whose name starts with a digit, use FindFirstChild("1stFloor") or square brackets instead of a dot.
local winners = { "Ana", "Ben" }
local firstPlace = winners[1]
local secondPlace = winners[2]
print(firstPlace, secondPlace)
local floor = workspace:FindFirstChild("1stFloor")
print(floor)
Two decimal points, or a missing comma between numbers
Version numbers like 1.2.3, or a comma typed as a dot inside Vector3.new(0, 5.5.0, 0), give a number with two points.
local part = Instance.new("Part")
part.Position = Vector3.new(0, 5.5.0, 0)
part.Parent = workspace
Separate numbers with commas, and keep version numbers as text: "1.2.3".
local GAME_VERSION = "1.2.3"
local part = Instance.new("Part")
part.Anchored = true
part.Position = Vector3.new(0, 5.5, 0)
part.Parent = workspace
print(GAME_VERSION)
Fix it in your place
Paste the error, RoCode fixes it in your place
Copy the line from Output and paste it here. RoCode opens the script it names in the place you have open in Studio, works out which of the causes above it is, and edits the code there instead of handing you a snippet to paste.
RoCode is an AI agent for Roblox Studio: it reads the scripts in the place you have open, finds the line and edits it there, and every change is an undo point. It runs on Windows or macOS with a desktop browser. Free to start, with free credits every day.
How to find the line that causes it
- A syntax error stops the whole script before its first line runs, so nothing in that script works, not just the broken line.
- Open the script. The Script Editor underlines the problem in red; hover over the underline to read the message.
- Open Script Analysis (View tab) to see every syntax error in every script, with its line number. Double-click one to jump to it.
- The line number in the message is where Luau gave up, which is often below the real mistake. The
(to close ... at line N)part points at the line where the unclosed bracket or block starts.
Questions
Can a variable name start with a number in Luau?
No. Names start with a letter or an underscore, and may contain digits after that: player2 is fine, 2player is not.
How do I write big numbers clearly?
Use underscores: 1_000_000 is one million. Do not use commas, which split the value into separate numbers.
How do I reach a part whose name starts with a digit?
Use workspace:FindFirstChild("1stFloor") or workspace["1stFloor"]. A dot only works when the name is a valid Luau name.
Can RoCode fix it?
Yes. Paste the Output line into RoCode. It reads the script in your open place and fixes the number or the name.
Sources and further reading
- Luau: syntax. number literals, binary literals and digit separators
- Roblox Creator Docs: numbers
- Roblox Creator Docs: variables. naming rules
How the code was checked: every block marked Fixed passes Luau's strict type checker against Roblox's API definitions (luau-lsp, 5 November 2026), and every block marked Breaks compiles only to fail with the message on this page. The message wording was checked by compiling each broken block on this page with luau-compile, which uses the same Luau parser as Roblox Studio, on 5 November 2026. A type check catches misspelt APIs and wrong types, not game logic, so playtest in Studio before you publish.