Explain Lua code
Paste Lua, Roblox game scripts included, and Vibe explains what each table holds, what a colon call passes and how a metatable makes a class.
Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.
Vibe25 lines selected
Press Explain it for the sample, or paste your own code first.
What this Lua sample shows
- tables
- The table is Lua's one data structure, and the sample uses it three ways:
scoresmaps names to points, each{ name = name, score = score }is a record, androwsandlinesare lists numbered from 1. Reading a missing key givesnil, soself.scores[name] or 0starts a new player at 0. - metatables
setmetatable({ scores = {} }, Leaderboard)makes a board that looks up any key it doesn't have inLeaderboard, becauseLeaderboard.__indexisLeaderboarditself. The board holds onlyscores, soboard:addfindsaddonLeaderboard.board:add("nova", 30)is short forboard.add(board, "nova", 30), and that first argument isself.
Good to know
- With
novaadding 30 and then 20,blitz45 andecho50,board:top(3)returns1. echo: 50,2. nova: 50and3. blitz: 45. pairsvisits keys in no set order, sotable.sortdecides the order: higher scores first, and a tie goes by name, which is whyechocomes beforenovaon 50 every time.- Names are compared as text, and in this run capital letters sorted before lowercase ones: three players tied on 10 come out as
Bolt,Zed,alpha. Comparea.name:lower() < b.name:lower()to ignore case. math.min(count, #rows)stops at the players there are:top(10)with three players returns three lines, and an empty board returns an empty table.- The sample uses only standard Lua, no Roblox APIs, and was run with Lua 5.5. In Roblox it would usually sit in a ModuleScript that ends with
return Leaderboard, which other scripts load withrequire.
Watch out: Methods need the colon. board.add("nova", 5) with a dot passes "nova" as self and 5 as the name, and fails with attempt to index a nil value (field 'scores'). Leaving out the points fails too, with attempt to perform arithmetic on a nil value (local 'points').
Explain Lua code beside your editor
Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).
Install on Mac
curl -fsSL https://unvibe.site/install.sh | bashPaste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.
Or download the .dmg · Intel Mac build · SHA-256 checksums
Opening the .dmg the first time
- Open the .dmg and drag Unvibe to Applications.
- Open it once; macOS says it can't verify it. Click Done.

Real screen, macOS 15 - System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.

Real screen, macOS 15
The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open