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
gibt es eine Lua/Luau lern website

i will Lua/Luau lernen damit ich roblox spiele für mich und meine freunde machen kann

https://redd.it/1p29fcc
@r_lua
Hello. Starting from scratch, new to Lua, and coding in general. Where should I start?

Basically what it says on the tin, I hope to reach the end goal of creating a boat mod for project zomboid build 42 (despite the great difficulties that will come with it as seen from those who had already done it in b41), and coding games on roblox as well, and since Lua is required for both, I am here. Advice appreciated!

https://redd.it/1p4cf6f
@r_lua
Roblox collection (2025 - 2006) (Steal a brainrot noscripted & Grow a garden)

also includes Azure Latch stand awakening aut and more..

https://codeberg.org/RobloxCollection/Roblox\_Game\_Collection

https://preview.redd.it/qjgqrbhmwx1g1.png?width=2250&format=png&auto=webp&s=df38ca1b56377c67d8bf6660bb29c64f35456f8f

https://preview.redd.it/c3ky87towx1g1.png?width=2264&format=png&auto=webp&s=a6d2b749418c1ebe26ae10ea9859c18e73e79018

https://preview.redd.it/vogsrpfrwx1g1.png?width=2264&format=png&auto=webp&s=9cc2e1b9174e72844fbcc99944aa2d0b2cf91985

https://preview.redd.it/l29v06zswx1g1.png?width=2250&format=png&auto=webp&s=f3f0a68e70291f47af12f9383b771a699e812bb9

Whats new:

2014_empty.rbxl
2025_Click_Tower.rbxl
2025_MMP_X.rbxl
2025_Squid_Game_Glass_Bridge.rbxl
2025_Steal_A_Dragon_Ball.rbxl
2008_Dark_Plateau.rbxl
2008_Lemur_Land_Mall.rbxl
2009_Heli_Wars_Winter_Mayhem.rbxl
2013_Castle_of_Birds.rbxl
2014_London_England.rbxl
2014_Mermaid_and_Fairies_Underwater.rbxl
2014_SS_Grandure.rbxl

https://redd.it/1p4njr6
@r_lua
lua and python

hello! i've been wanting to learn lua for a while, so i can learn how to make a certain roblox game. but i was thinking about python because it is a better software, if i learned python first, in a few years would lua be easier?

https://redd.it/1p4ouby
@r_lua
Linked List speed vs table, not as expected?

I wrote a basic SLL implementation as part of my learning process with Lua and decided to do a bit of execution time testing to see how it held up compared to tables. Now, I recognize that tables are highly optimized, but I was a little surprised by what I found. Using a Linked List as a queue or stack had the same results, but it is taking a little more than twice as long as using a table (stack only, queue it is way slower).

Any idea why it is so much slower when both the Linked List and the table should be operating in O(n) time?

Here is the Linked List module

Here is the Linked List tester noscript and the table tester.

Cheers!

https://redd.it/1p658ch
@r_lua
How to do a noscript that detects when a capture card freezes and then deactivates and reactivates the capture card to fix it when obs or the noscript is bad at detecting when the capture card froze?

So I have a capture that has a problem to randomly freeze at least once during certain points but the problem is when it freezes audio still is going through perfectly and I think obs recognizes it as not frozen however when it freezes it stays frozen on a certain frame during the stream and only gets fix from activating and reactivating but the problem with any noscript I tried is they can’t detect when the freezing occurs because I believe obs doesn’t even detect the capture card froze since audio still goes through. So is it possible at all to fix this issue with a noscript or something that does work?

https://redd.it/1p66bbp
@r_lua
Working with arbitrary numbers of args, emulating Python's slice?

This has come up as I've been working with the language and it hasn't been a problem yet, but I could see it being an issue. I think the easiest way to explain my question is to give an example:

import sys

# Print the given args, starting with the third and continuing through any number of given args
def printargs(*args):
for a in args:
print(a)

printargs(*sys.argv[2:])

If I run this with runfile(args='a b c d e'), it will print:
b
c
d
e


This functionality with slices is really handy when you want to deal with an arbitrary number of arguments in a noscript.


In Lua, I've been working with varargs a bit, but my understanding of them is limited. Particularly, how you could go from a table of given arguments (the built-in arg table) to a vararg to give to a function, starting at a given index? Or maybe this isn't a relevant problem when working with Lua?


https://redd.it/1p7by1n
@r_lua
Starting In Lua

Hello, I've been interested in learning how to program in Lua because I want to make Roblox games for fun and also get a sense of what programming is about. So I'm here to ask: how did you start learning? Is there any free online program that's worth it? Your experiences and advice would be a lot of help.


Thank you!

https://redd.it/1p7kgs4
@r_lua
Writing compact code - how do I check for multiple possibilities all at once in the shortest statement possible?

I'm a relative newbie to Lua and I'm curious about ways to very compactly write a check for multiple possible values. Consider the following code:

if value ~= "a" and value ~= "b" and value ~= "c" then

Obviously functional for an if statement, but I want to know if there's a less repetitious way to write it. Does Lua have any tricks for making this more compact? If so, could these tricks be scaled up for checking large numbers of possible values all at once?

https://redd.it/1p7msep
@r_lua
Convert C header file to more machine-readable format?

Is anybody aware of a standard for specifying the API of an object file (lib.so) besides a C header file (.h file)?

I'm designing my own assembly language and want to consume and link headers to link with dynamic libraries produced by C. It would be nice to not need to implement my own C compiler to do so.

https://redd.it/1p8it8l
@r_lua
Can someone tell me why this code doesn't work

Simply trying to iterate through a table, and nothing is printed out, why?

local myTable = {}

local myStruct = {}
myStruct.myValue = 5
myStruct.myOtherValue = "Bears"

myTable"Joe" = myStruct
myTable"Suzy" = myStruct

for name, struct in pairs(myTable) do
print("myValue= " .. struct.myValue.. ", myOtherValue = " .. struct.myOtherValue .. "\n")
end

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