r/learnprogramming • u/GodOfKnockers • Oct 20 '26
Wanting to learn LUA Script
So I'm modding games and I am making a mod for Balatro, which uses LUA. I tried to look for books at the library but all I could find was modding bocks for Roblox (NO TO THAT).
Can anyone point me in the right direction, please?
10
Upvotes
2
u/abrahamguo Oct 20 '26
Have you taken a look at the "Getting started" section of the official Lua website?
2
u/Simpicity Oct 20 '26
If you want to learn Lua, Roblox is a very good way to go. It's not like you have to publish anything.
2
u/toxic_prince21 Oct 20 '26
Balatro runs on LÖVE, which uses LuaJIT. That’s basically Lua 5.1, so learn that version.
Learn tables first. They’re Lua’s only data structure, so lists, records and modules are all tables.
2
u/bae-alves Oct 20 '26
Started with Pico-8's LUA dialect, then went for learning LÖVE.
1
u/meetisa Oct 20 '26
for the syntax there is the official documentation, but i guess are you asking for sources to learn programming in general?
1
u/Cootshk Oct 20 '26
Balatro is written in Love2D, go check their wiki, it has some great resources
Also, https://learnxinyminutes.com/lua if you already know a different programming language
1
u/xchino Oct 20 '26
How about Minecraft instead? Check out the ComputerCraft mod.
1
u/B0mbon Oct 20 '26
Honestly the best book is still Programming in Lua by Roberto Ierusalimschy, he's one of the people who made the language, and an older edition is fine for modding. But since you're brand new I'd learn just enough basics (variables, tables, functions, if/for) and then open an existing small Balatro mod and read it line by line. Modding is mostly reading other people's code and changing one thing at a time, so pick a tiny mod like a single joker and try to tweak what it does. Tables are the big Lua thing, once those click most mod code starts making sense.
1
u/Blissextus Oct 20 '26
You can either learn LUA via:
1
u/symmetricon Oct 20 '26
https://www.lua.org/manual/5.5/manual.html
This is the documentation provided by lua. Start with the introduction. Create a lua file, learn how to run it from the command line. In the file, try each thing you learn from then docs and print out the results
1
u/rokon_pt Oct 21 '26
There is cs50 2d - I haven't done it, I'm not sure if it fits what you are looking for, but it would probably be my first option of wanting to learn Lua and love.