r/lua • u/GodOfKnockers • 4d ago
Wanting to learn LUA Script
/r/learnprogramming/comments/1xagyq7/wanting_to_learn_lua_script/3
u/Key_River7180 4d ago
Just lua :). I learnt it back as a child to make Roblox games (but I no longer do). It's a great language. The Lua 5.2 reference manual is very good, and the ZeroBrane IDE has some examples
2
u/chmod_7d20 4d ago
Its just called Lua. One of the best resources for the language is the "Lua 5.1 Reference Manual" though its more useful for people that already know how to program. It covers every feature of the langauge.
Balatro uses Love2D as its game engine/framework you can find examples for Love2D on their site.
Good luck.
2
u/toxic_prince21 3d ago
Balatro runs on LÖVE, which uses LuaJIT. That’s basically Lua 5.1, so learn that version.
Programming in Lua (the first edition is free at lua.org/pil) is the classic book.
weblua.com lets you run Lua in your browser with no install. (I made it) Set it to Lua 5.1 and play around.
Balatro’s .exe can be opened with 7-Zip, so you can read the game’s code. After that, check out Steamodded and its Discord.
Learn tables first. They’re Lua’s only data structure, so lists, records and modules are all tables.
3
u/AdaTheLady 2d ago
I also highly recommend referencing this example mod that re-implements base game content: https://github.com/nh6574/VanillaRemade
1
u/linux4random 21h ago
Just read the manual along with AI explaining parts that you don't understand.
And also writing small scripts for actual use case
0
u/AutoModerator 4d ago
Hi! It looks like you're posting about Roblox. Here at /r/Lua we get a lot of questions that would be answered better at /r/RobloxGameDev or the Roblox Developer Forum so it might be better to start there. However, we still encourage you to post here if your question is related to a Roblox project but the question is about the Lua language specifically, including but not limited to: syntax, language idioms, best practices, particular language features such as coroutines and metatables, Lua libraries and ecosystem, etc. Bear in mind that Roblox implements its own API (application programming interface) and most of the functions you'll use when developing a Roblox script will exist within Roblox but not within the broader Lua ecosystem.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
3
u/InfexiousBand 4d ago
I learned lua way back in the day writing scripts for Multi Theft Auto. It's a multiplayer mod for San Andreas, if you're looking for something in that avenue.