Errors and fixes
When a script throws an error it stops, and the message shows in a red box on its page. Fix the line and save: it starts again.
Reading an error
kill_feed.lua:27: attempt to index a nil value (local 'me')kill_feed.luais the file,27the line. Press Edit in the error box to open the script in the editor.- The text after the colon is what went wrong; the part in brackets names the variable.
- Copy puts the whole error on the clipboard, ready to paste into an AI or a support chat.
Common errors
attempt to index a nil value
kills.lua:12: attempt to index a nil value (local 'me')You used a field of something that is nil. game.local_player() is nil when you are dead, entity.* fields can be missing, bomb.state().pos is missing when unknown.
local me = game.local_player()
if not me then return endattempt to call a nil value
hud.lua:5: attempt to call a nil value (field 'draw_text')The function name is wrong (here draw.text), or it does not exist in this API. Check the spelling against the reference. os.*, io.* and require are not available.
draw.text(10, 10, "ok", white)attempt to perform arithmetic on a nil value
bar.lua:20: attempt to perform arithmetic on a nil value (global 'kils')A typo in a variable name, or a value that was never set. Globals that were never assigned are nil.
local kills = 0
kills = kills + 1attempt to concatenate a nil value
feed.lua:9: attempt to concatenate a nil value (field 'victim').. cannot join nil. Use tostring(x) or (x or "").
print("killed " .. (e.victim or "?"))attempt to compare number with nil
x.lua:4: attempt to compare number with nilOne side of < or > is nil, often ui.get with a wrong id.
local size = ui.get("size") or 16bad argument #N to ...
bad argument #5 to 'text' (number expected, got nil)You passed the wrong type. Here the colour was nil. Every colour must be an integer from color().
local white = color(255, 255, 255)
draw.text(10, 10, "hi", white)script ran too long (infinite loop?)
script ran too long (infinite loop?)One callback took more than 8 ms or 1 000 000 instructions. Look for a while loop that never ends, or heavy work every frame. Do it once and cache it, or spread it over several frames.
if not cache then cache = build() endnot enough memory
not enough memoryThe script used its 64 MB. Usually a table that grows every frame and is never cleared.
if #log > 200 then table.remove(log, 1) endunexpected symbol / 'end' expected
kills.lua:30: 'end' expected (to close 'function' at line 12) near <eof>A syntax error. Every function, if, for and while needs its own end. The line number where Lua noticed can be far from the real mistake.
needs permission: settings
needs permission: settings, allow it on the script pageNot an error: the call returned false. Open the script's page and tick the permission under PERMISSIONS.
config.set: wrong type for ...
config.set: wrong type for aim.fovThe new value has a different type or shape than the setting. A colour is a table of 4 numbers from 0 to 1, a bool needs true/false.
config.set("aim.fov", 4.5)config.set: unknown setting ...
config.set: unknown setting esp.boxcolorThe key does not exist. Keys are case-sensitive: esp.boxColor and esp.boxcolor are different. Check Settings keys.
http.get: only https://adolfjon.uz/ is allowed
http.get: only https://adolfjon.uz/ is allowedOther websites are blocked on purpose.
image: not a PNG/JPG or larger than 2048x2048
image: not a PNG/JPG or larger than 2048x2048Convert the file or make it smaller. WebP, GIF and SVG are not supported.
font: ... not found
font: myfont.ttf not found (data folder or Windows Fonts, .ttf/.otf)Put the font in scripts/data/<script>/ or use one installed in Windows. Names are exact, for example segoeuib.ttf for Segoe UI Bold.
Debugging tips
print(json.encode(value))shows what is inside a table.- Print once, not every frame: use a flag, or
on_tickwith a timer, or the console fills up. - Wrap risky code in
pcallto keep the script running and log the error yourself:
local ok, err = pcall(function()
local data = json.decode(files.read("cfg.json") or "")
print(data.name)
end)
if not ok then print("could not read cfg.json: " .. tostring(err)) end