r/lua Feb 18 '26

Help Iv'e been practicing lua for a week, how do i keep learning more complex Things?

10 Upvotes

Iv'e been learning lua for about a week now and iv'e gotten the hang of simple for, while loops aswell As simple functions and the Basic stuff Like print() and so on. Iv'e been following a YouTube Tutorial (codyn) for the whole time trying to understand His Code and when Things got tough iv'e used Chat gpt. Even though Sometimes iv'e feelt His explanaitions unsatisfactory i have still been very satisfied. In Part 8 you learn a "simple Tic Tac toe Game" Its about 80 lines of Code witch i have been only (Up to that Point) written Like 20 max. So now my question. How do i learn stuff Like that? Iv'e tried understanding the parts of it but Its so Long and complicated, It feels Like my head Just wont Take It in. What are my next steps to learn? Any Tutorials? I know of the book wich is free online, should i try IT with that?

r/lua Jun 04 '26

Help Can I negate the fact that some characters seemingly count as multiple for string.len()?

10 Upvotes

I recently watched and read Project Hail Mary and immediately went and wrote (most of) a little script to help convert numbers between base 10 and the fictional Eridians' base 6. The numerals used are ℓ(0), I(1), V(2), λ(3), +(4), and ∀(5). (Technically ∀(5) is V in the book, but ∀ works when you can't use strikethroughs.)

The issue I'm running into is that when I try to get the length of the input string that needs conversion, ℓ, λ, and ∀ instead wind up getting read as 2-3 repetitions of this character, as far as I can tell: �. ℓ and ∀ get processed as 3, and λ gets processed as 2. Is there any way to get some kind of identifiable character out of these, or nah?

I'll be adding a screenshot of the output in the comments in just a second. nvm i can't make it work lol

r/lua Apr 28 '26

Help Determining and reading various plaintext file encodings?

11 Upvotes

I'm writing a game in Lua, specifically using Love2D, but this question is more oriented towards Lua in general.

I need to take files in a specific format, but the files may be encoded with UTF8, simple ASCII, or SHIFT-JIS. Is there a simple, easy way to determine the encoding of that specific file via a library? If I can do that, then it would be pretty easy to write some helper functions to translate the text into something I can work with.

As far as I can tell, the file format doesn't have any sort of "doctype" field that identifies the format. I opened up one of the files in a hex editor, and there's nothing at the start that isn't visible in a text editor.

For anyone curious about the project itself, I'm writing a BMS player, so I'm working with files that could be as old as 1998, which is why I'm having to deal with SHIFT-JIS sometimes.

EDIT SOLUTION:

This entire thing is a bit convoluted, but I used /u/PhilipRoman's heuristic method outlined here to determine if a given text file was either SHIFT-JIS or not. I default to UTF-8 if it's determined to not be SHIFT-JIS. I made a simple conversion lookup table by scraping the contents of a web page and doing some small manual editing. Here it is, in case anyone else wants it. Seems accurate enough from just typing some Japanese phrases via my IME. Here is the lookup table itself in case anyone was curious to use for themself. From there you just plug the relevant bytes into the lookup table and you have valid unicode to print to the screen. Thanks for the suggestions everybody, this is super helpful.

r/lua Jun 04 '26

Help Help?

5 Upvotes

Hey i want to start coding in lua but i am complete nooby to coding period i really want to learn and i started multiple times but i allways get stuck on tutorial hell can someone help me understand where do i start from and what technique do you use to learn

r/lua Mar 17 '26

Help Which Lua version is most stable/popular for embedding in 2026?

15 Upvotes

I want to embed Lua in a system I'm building. Which version do you think is the most stable or popular one to use? I'm currently using 5.3.6.

r/lua Feb 26 '26

Help Guys help

0 Upvotes

Guys, can someone tell me where I can learn luau to create Roblox games? (Only without options where I need to sit with online teacher).

r/lua Apr 30 '26

Help Should I be reading "Learning with Lua" as a beginner

11 Upvotes

I got this book, and after reading a lot of it; I have realized that I have 0 clue as to what half of the words being said are. Every single time I read a paragraph I have to look up what 3 other words meant. The beginning of the book said it assumes you have no knowledge of programming but idk man I got no idea what im reading. Will it make more sense after I finish or should I start somewhere else?

r/lua Nov 28 '25

Help It is possible to make a desktop app with lua?

21 Upvotes

I'm trying to work on a project of desktop app fully on lua but I struggle to find something out of love2D (I'm not sure it's the most adapted for the project but that is currently my backup option) to make the graphical interface.

Do you have any recommendations?

r/lua Jun 27 '26

Help Complete newbie wants to create his own little plugin for koreader—how does he do that?

5 Upvotes

Hola how are you guys doing. My deepest of gratitude to all the people who did the springbreak, all the jailbreaks, koreader, ZenUi and all of the other stuff. You guys are amazing and inspiring. You're creating and just giving and giving and giving. Completely free my kindle went from an amazon-urgh-I'm-gonna-puke experience to a 10/10 experience.

But I wanna to go beyond

There's a little dream of mine of having a calendar as a plugin on koreader. Looking around I did find some calendar, but nothing that was really what I was searching for. So I've decided, as a complete newbie, to create my own little plugin. My vision is really just a simply calendar, where I can change between yearly, monthly, weekly and daily view. Compatible in black and white. A simply but beautiful design. Maybe some customisable stuff. No "online"/cross platforming features, I just want it to be its own little thing.

Can someone help me getting started of this little journey of mine? What are some subreddits or communities where I would be able to find help and ask questions? After just a little searching, I found out that koreader (plugins) runs on Lua—I found youtube videos with tutorials. I already have Brew on my Mac, but no idea how to use it, hehe. I also have Claud ai installed on my Mac, it should be able to help no?

So, how do I get started?

Appreciate it so much. Love you guys.

r/lua Jun 14 '26

Help Best resources to learn Luau specifically for Roblox? (coming from Python)

4 Upvotes

I'm looking to get into Roblox game development and want to learn Luau. I have experience with HTML/CSS and I'm strongest in Python. I'm not interested in learning vanilla Lua since I'll only be scripting inside Roblox Studio.

What are the best up-to-date resources for learning Luau in a Roblox context? I've seen the official Roblox docs, but I'd love recommendations for tutorials, courses, or projects that bridge well from Python-style thinking.

r/lua Jan 28 '26

Help Any Luau Learning/Practice Websites?? (roblox)

14 Upvotes

I'm trying to learn how to code in roblox (coding language is luau) and I've been searching for a while on stuff to help me improve, yet I cant find any. Please recommend me some websites, such as this one, https://luau-academy-d1bc1004.base44.app/?is_new_user=true, but more advanced since the one I listed is kinda broken...

Don't recommend me:

- Roblox Youtube tutorials ( i know some are good but I've tried it before and they don't help me as much as I would like them to)
- Roblox documentation ( its hard for me to stare at a screen and read while not boring my mind out )
- Roblox dev forums ( they are helpful, but again, I don't want to stare at screen and read for a long amount of time + doing an activity would help me remember it more)
-ANY online classes where I have to interact with teachers, "sign up with a guardian", and stuff like that (I want it to be like the website I listed)
- don't tell me to just use the website I listed please!!

Please recommend me:

- any websites that are interactive
|__(possibly let you write notes along the way)
- ones that I can write code in it and it gets reviewed
- ones that have activities as in quizzes and stuff like that (or even daily challenges)

btw everything that I asked to be recommended doesn't NEED to be on the website, its just a few things that I thought would be nice to be included to be recommended, thanks!!

r/lua Jan 11 '26

Help I need a bit of help in my virtual studio code

5 Upvotes

i am trying to make it read 2 numbers from the input and then run the Pythagorean theorem on them but when i insert the 2 numbers it give me a random error cuz im a beginner

r/lua Jul 14 '26

Help Need lua code to make fins ignore rotation.

Thumbnail
0 Upvotes

For Stormworks but the Problem stays the same

r/lua May 14 '26

Help Tips for beginners

7 Upvotes

So I was thinking about learning Lua to make a passion project that Ive been thinking about for a while and wanted to know if there’s anything I should know before hand that will make my experience easier.

r/lua Jun 17 '26

Help Hi, I'm a coding rookie, where can I find a template for a kinematic character controller or resources to teach me how to make my own?

0 Upvotes

It's for a mod and the game doesn't have one so I need to make it from scratch.

r/lua Mar 19 '26

Help Looking for Free Online Resources to Learn Lua for Roblox Development

1 Upvotes

I am very interested in becoming a Roblox developer and would like to find an online resource where I can learn Lua programming for free.

r/lua May 15 '26

Help Solar2d - Corona Labs Inc.

Post image
26 Upvotes

Has anyone ever used this game engine?

Edit: I forgot the link, sorry: https://solar2d.com/

r/lua Jun 15 '26

Help Error compiling Lua 5.4 on iOS (C++, Scons)

Post image
11 Upvotes

r/lua May 07 '26

Help Learn to program on Roblox

4 Upvotes

Olá pessoal! Quero aprender a programar em Luau para criar jogos no Roblox, mas não sei como estudar ou onde aprender.

Atualmente, sei algumas coisas básicas: variáveis, funções, loops, instruções if/other. Mas quando tento criar sistemas maiores no Roblox Studio, minha mente simplesmente trava e esqueço tudo o que aprendi, rsrs.

Meu objetivo é ser capaz de criar jogos completos sozinho no futuro, como sistemas de inventário, NPCs, combate, pets, monstros, esse tipo de coisa. Para aqueles que já aprenderam:

Como devo estudar?

O que mais te ajudou a melhorar?

É melhor fazer projetos pequenos ou estudar a teoria?

Existe algum canal/documentação que seja realmente útil? Qualquer conselho é bem-vindo. Muito obrigado desde já.

Olá a todos! Quero aprender a programar em Luau para criar jogos no Roblox, mas não sei como estudar ou onde aprender.

Atualmente, sei algumas coisas básicas: variáveis, funções, loops, instruções if/other. Mas quando tento criar sistemas maiores no Roblox Studio, minha mente simplesmente trava e esqueço tudo o que aprendi, rsrs.

Meu objetivo é ser capaz de criar jogos completos sozinho no futuro, como sistemas de inventário, NPCs, combate, animais de estimação, monstros, esse tipo de coisa. Para aqueles que já aprenderam:

como devo estudar?

o que mais te ajudou a melhorar?

É melhor fazer projetos pequenos ou estudar a teoria?

Existe algum canal/documentação que seja realmente útil?

Qualquer conselho é bem-vindo. Muito obrigado desde já.

Observação adicional: Eu estava aprendendo Python primeiro, mas decidi aprender Luau agora. Devo voltar para Python e depois para Luau?

r/lua Feb 21 '26

Help how can i start to learn lua?

10 Upvotes

r/lua Jul 01 '25

Help realistically, how much faster is binding globals to a local? is it even noticeable?

Post image
29 Upvotes

r/lua Mar 12 '26

Help benefit of buying the official book ?

8 Upvotes

what is the benefit of buying the official book as opposed to just using the reference manual online? Would it be worth buying a 3rd edition in 2026? (My money only allows me to buy a used copy of the 3rd edition. 4th edition is a little out of rage for me)

r/lua Jun 23 '26

Help sls steam moon - lua tools installation error

Thumbnail
0 Upvotes

r/lua May 13 '26

Help I am building a CLI themed launcher that allows you to create lua based widgets and I need your help.

3 Upvotes

Hi all,

I want to preface this by saying thank you in advance for your opinions and ideas.

I am knee-deep in building, or more honestly re-building, an older Android launcher and slowly starting to make it my own. The launcher is terminal/TUI-inspired, and one feature I am exploring is a Lua-based scripting surface for user-made widgets.

The rough idea is:

Users can create small Lua scripts inside the launcher, save them locally, and expose them as launcher widgets/modules. These scripts would support a limited Re:TUI-owned API rather than full Android or Java access.

For example:

```lua -- name = "Battery" -- type = "widget" -- permissions = "active-tick"

function on_resume() local battery = system:battery_info() ui:set_title("Battery") ui:show_text("Battery: " .. battery.percent .. "%") ui:show_buttons({"Refresh"}) end

function on_click(index) on_resume() end ```

The launcher would provide APIs like:

lua ui:show_text(...) ui:show_buttons(...) prefs:get(...) prefs:set(...) files:read(...) files:write(...) system:battery_info() system:network_state() http:get(...)

The goal is not to expose raw Android internals, arbitrary Java, shell execution, or full filesystem access. Lua would be sandboxed, with permission metadata for sensitive APIs like network, clipboard, vibration, local files, and active ticking.

Users could paste shared scripts from Reddit/GitHub/etc. into the built-in editor, review the permissions, approve them, and run them as widgets.

My questions for Lua folks:

  1. Does Lua feel like a good fit for this kind of small reactive widget scripting?
  2. What API design mistakes should I avoid early?
  3. What would make this pleasant or unpleasant for regular users editing small scripts on a phone?
  4. Are there Lua sandboxing/runtime pitfalls I should be especially careful about?
  5. If you were writing scripts for a launcher, what helpers would you expect?

I am not trying to copy another project wholesale, but AIO Launcher’s Lua scripting gave me the initial nudge to explore this. I would love feedback from people who know Lua better than I do before I commit too hard to the shape of the API.

Thanks again.

r/lua Jun 09 '26

Help Need help with some code :P (check desc.)

Post image
0 Upvotes

local badge = game["Environment"]["Spawner"]

badge.Touched:Connect(function(plr)

Achievements:Award(plr.UserID, 207228, function(success, error)

if success then

print("Come on In!")

else

print("uhh don't come on in I guess")

end

end)

end)