Lua - Reddit – Telegram
Lua - Reddit
30 subscribers
278 photos
31 videos
4.23K links
News and discussion for the Lua programming language.

Subreddit: https://www.reddit.com/r/lua

Powered by : @r_channels & @reddit2telegram
Download Telegram
I built KeyCaster.spoon: a keystroke overlay for Hammerspoon (configurable, multi-display, MIT)
https://redd.it/1nadh7w
@r_lua
I just downloaded VS Code on my steam deck but Lua doesnt work

I checked my steam os terminal and it says Lua exists but whenever I try using the 'lua -v', it says the lua command doesnt exist. I tried every way to download lua on VS Code like changing the shell but nothing works. How do I fix this?

https://redd.it/1nagudp
@r_lua
Open-sourced my chiptunes maker done for a gamejam (LÖVE)
https://redd.it/1nbkzfv
@r_lua
Lua to apk

Hello,



I apologize in advance if this isn't the right place, or if the answer already exists, but I couldn't find anything. Maybe I didn't search properly.



I made a small, insignificant game in Lua (which taught me the language, which was one of the two goals). This game is just for me and a few friends.



I just wanted to make a small game on an Android phone to keep me busy while commuting.



The game isn't finished, but it's testable, and I'd like to try it on a mobile phone. But I'm a complete idiot and I don't understand how to do it at all. Is there an easy way to generate an APK so I can share it with my friends? I know you can launch it with a .love file and a dedicated application, but it's not practical for distributing it to my friends, and especially the game launches in landscape mode even though it's designed for portrait mode, making it unplayable because everything overlaps.



Thank you in advance for your help.

https://redd.it/1nbu6px
@r_lua
Saving content of the program

Hi! I learned lua a couple years ago but I don't practice often. One time i tried to create a diary in lua using löve2d to make the UI, but I struggled to make a saving function. I didn't used any other libraries unless the base lua and löve2d. I know that exists the table io but I struggled to use it. Can somebody help me?

https://redd.it/1nbuoov
@r_lua
Numpy for luau?

Hello all!

I plan on implementing add-on support for my pet project, and so far Luau looks like the most battle tested solution! I love the sandboxing and the type checking features!

Performance of generating 5 242 880 numbers (math.noise), by default, is 0.6 sec, vs 0.19 in cpp.

I managed to get a primitive array type working when I realized the bottleneck is the stack between the Lua and the Cpp world. With this I managed to get the runtime down to 0.26, which is good for an interpreted language.

https://github.com/luau-lang/luau/discussions/1994

Is there a numpy-like library I can use with Luau? I can implement the methods more or less but I feel like I would duplicate work and my version would be sub standard.

I found numlua and lua-linear, but both seems abandoned.

https://redd.it/1nbw374
@r_lua
[Release] CursorScope.spoon — cursor highlight + live magnifier for Hammerspoon
https://redd.it/1ncbsvw
@r_lua
A Lua Style Guide for the Community

Hey everyone,

I’ve been working on a **Lua style guide** and wanted to share it with the community.
The goal is to improve code readability and consistency, and to provide a reference that teams or individual developers can adopt.

The guide covers things like:

* Naming conventions
* Formatting (indentation, whitespace, line breaks)
* Table and function usage
* Performance tips
* Common pitfalls and best practices

You can check it out here: [https://github.com/ShaharBand/lua-style-guide](https://github.com/ShaharBand/lua-style-guide)

This isn’t meant to be the “one true way” to write Lua, but rather a starting point for discussion and refinement. I’d love feedback, suggestions, or contributions—whether you agree, disagree, or have alternative conventions that work well for you.

Hopefully this can grow into something the Lua community finds useful, especially for newcomers who want a clear reference on writing clean Lua code.

What do you all think?

https://redd.it/1ncqnx7
@r_lua
luau

Alguém pode me explicar como funciona o código luau o que é usado em jogos do Roblox estou com uma grande dúvida

https://redd.it/1ncuh4n
@r_lua
How do I learn roblox lua?

So i've been wondering how i learn lua i tried to watch youtube video's but they all cover up the same i actually wanne learn the coding not those basic things.

https://redd.it/1nda1ld
@r_lua
documentação?

eu basicamente tô engatinhando em aprender lua, fiz alguns vírus de ambiente controlado que abrem várias abas com whole e tô aprendendo a parte dos If/whole e etc.
porém tudo que aprendi até agora foi com um amigo que já sabia um pouco mais, queria saber onde acho documentação oficial de lua

https://redd.it/1nds7ot
@r_lua
I’m trying to make an Animal Crossing type Roblox game but idk how to code (Roblox code is Lua code. Username on Roblox is WigglesWantsCheese)

I’ve been dreaming of a game like animal crossing for months now but I don’t know how to code. I’m also rlly broke so if you want to do it 4 free. Or we can split the profit from the game. Think of me as…. The animator and the music guy. But idk how to import the animations to the proper sequences

View Poll

https://redd.it/1nfnjst
@r_lua
What did I do wrong😭
https://redd.it/1ngehsg
@r_lua
What did I do wrong 😭
https://redd.it/1ngergn
@r_lua
Is there any discord server for sharing lua code?

I know about the Libera channel and the mailing thing, but I don't really like the format of those.

I considered just posting exercise solutions and etc here, but the sub doesn't have that many posts, so it would become quite spamy.

TLDR: where should I share my code to know if I am doing best practice/just to talk about it?

https://redd.it/1nghdh6
@r_lua
I’m creating another poll because everyone would rather die then help me make a game in Roblox (Roblox is lua) it’s an animal crossing type game. We can split the profit. Username on Roblox is MrWIggles555555

I need a pro noscripter,
Someone to import the animations I make into inputs,
Someone to make a thumbnail
I got the other stuff like camera and music

View Poll

https://redd.it/1nh1hht
@r_lua
HELP! Recoil Script

Can someone help me? My recoil are good but after 3 seconds its going down.


EnablePrimaryMouseButtonEvents (true);

function OnEvent(event,arg)

if IsKeyLockOn("CapsLock")then

if IsMouseButtonPressed(1)then

repeat

if IsMouseButtonPressed(1) then

repeat

MoveMouseRelative(0,1)

Sleep(12)

until not IsMouseButtonPressed(1)

end

until not IsMouseButtonPressed(1)

end

end

end

https://redd.it/1nhb2za
@r_lua