moonbeam - a tool for converting single Lua noscripts into standalone executables
https://github.com/htogta/moonbeam
https://redd.it/1nnaabs
@r_lua
https://github.com/htogta/moonbeam
https://redd.it/1nnaabs
@r_lua
GitHub
GitHub - htogta/moonbeam: A silly way of compiling a lua noscript into a single executable
A silly way of compiling a lua noscript into a single executable - htogta/moonbeam
How to add type annotations to compiled C module
My lua module is implemented entirely in C. It is not quite yet ready for prime time, but it is close enough to start thinking about how to make it nice.
One of the things I want is luaCats type annotations. But I cant figure out how to add them to my compiled module?
In my rockspec I have these build instructions, which tell it to use my makefile, and set up passthru for the variables I will need as specified by their documentation. The build and main install step work, which require LUA\_INCDIR in build and LIBDIR in install
build = {
type = "make",
build_variables = {
LUA_INCDIR="$(LUA_INCDIR)",
},
install_variables = {
LIBDIR="$(LIBDIR)",
LUADIR="$(LUADIR)",
},
}
And in the makefile in my install step I do
install: $(SRC)/meta.lua
ifdef LIBDIR
$(check_so_was_built)
@mkdir -p "$(LIBDIR)";
cp "$(DESTDIR)/$(MYMODNAME).so" "$(LIBDIR)/";
@echo "Installed to $(LIBDIR)";
ifdef LUADIR
@mkdir -p "$(LUADIR)/$(MYMODNAME)";
cp "$(SRC)/meta.lua" "$(LUADIR)/$(MYMODNAME)/";
endif
else
@echo "LIBDIR not set, skipping install"
endif
The types in my meta.lua are correct enough and work when I am inside the project directory
However when I install my package via luarocks, usually my editor can find the types for the modules I installed. But for this one it cannot find the types declared in my meta.lua file if I try to declare them manually, nor does it associate `tomlua/meta.lua` with `require('tomlua')` as I thought it was meant to? It does seem to successfully get the meta.lua file to where I expect it to go to, but it isnt being picked up by the lsp.
https://redd.it/1nnpgz8
@r_lua
My lua module is implemented entirely in C. It is not quite yet ready for prime time, but it is close enough to start thinking about how to make it nice.
One of the things I want is luaCats type annotations. But I cant figure out how to add them to my compiled module?
In my rockspec I have these build instructions, which tell it to use my makefile, and set up passthru for the variables I will need as specified by their documentation. The build and main install step work, which require LUA\_INCDIR in build and LIBDIR in install
build = {
type = "make",
build_variables = {
LUA_INCDIR="$(LUA_INCDIR)",
},
install_variables = {
LIBDIR="$(LIBDIR)",
LUADIR="$(LUADIR)",
},
}
And in the makefile in my install step I do
install: $(SRC)/meta.lua
ifdef LIBDIR
$(check_so_was_built)
@mkdir -p "$(LIBDIR)";
cp "$(DESTDIR)/$(MYMODNAME).so" "$(LIBDIR)/";
@echo "Installed to $(LIBDIR)";
ifdef LUADIR
@mkdir -p "$(LUADIR)/$(MYMODNAME)";
cp "$(SRC)/meta.lua" "$(LUADIR)/$(MYMODNAME)/";
endif
else
@echo "LIBDIR not set, skipping install"
endif
The types in my meta.lua are correct enough and work when I am inside the project directory
However when I install my package via luarocks, usually my editor can find the types for the modules I installed. But for this one it cannot find the types declared in my meta.lua file if I try to declare them manually, nor does it associate `tomlua/meta.lua` with `require('tomlua')` as I thought it was meant to? It does seem to successfully get the meta.lua file to where I expect it to go to, but it isnt being picked up by the lsp.
https://redd.it/1nnpgz8
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua Scripter
I'm working on a Roblox game and need a Lua Scripter to build a mission system. Where can I find Lua Scripters?
https://redd.it/1np12ai
@r_lua
I'm working on a Roblox game and need a Lua Scripter to build a mission system. Where can I find Lua Scripters?
https://redd.it/1np12ai
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
my nvim lsp is not working
return {
{
"mason-org/mason.nvim",
config = function()
require("mason").setup()
end,
},
{
"mason-org/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls" },
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
vim.lsp.config("lua_ls", {
capabilities = capabilities,
})
vim.lsp.enable("lua_ls")
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, {})
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, {})
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
end,
},
}
https://redd.it/1np8pl9
@r_lua
return {
{
"mason-org/mason.nvim",
config = function()
require("mason").setup()
end,
},
{
"mason-org/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls" },
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
vim.lsp.config("lua_ls", {
capabilities = capabilities,
})
vim.lsp.enable("lua_ls")
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, {})
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, {})
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
end,
},
}
https://redd.it/1np8pl9
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I need to deobfuscate a code
https://raw.githubusercontent.com/nouralddin-abdullah/99-night/refs/heads/main/main-en.lua
I found this in my school group chat and idfk what is this
https://redd.it/1nphyt8
@r_lua
https://raw.githubusercontent.com/nouralddin-abdullah/99-night/refs/heads/main/main-en.lua
I found this in my school group chat and idfk what is this
https://redd.it/1nphyt8
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Looking for a Developer / Reverse Engineer
Looking for a Developer / Reverse Engineer
I’m seeking someone with strong experience in C# and LuaJIT (including working with runtime dumps and decompiled bytecode). The task involves analyzing and reversing some files, so familiarity with reverse engineering practices is important.
If you have the expertise and are interested, please reach out to discuss details.
https://redd.it/1nprqz7
@r_lua
Looking for a Developer / Reverse Engineer
I’m seeking someone with strong experience in C# and LuaJIT (including working with runtime dumps and decompiled bytecode). The task involves analyzing and reversing some files, so familiarity with reverse engineering practices is important.
If you have the expertise and are interested, please reach out to discuss details.
https://redd.it/1nprqz7
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Is it a good idea to use Lua (with JIT) in some serious applications?
I heard it has simplicity of Python combined with the speed of C-languages. I asked ChatGPT about it and it said they never use it just because people never do.
So, maybe I will be an exception? Because I like metatables and the Lua syntax itself
https://redd.it/1nq3iwf
@r_lua
I heard it has simplicity of Python combined with the speed of C-languages. I asked ChatGPT about it and it said they never use it just because people never do.
So, maybe I will be an exception? Because I like metatables and the Lua syntax itself
https://redd.it/1nq3iwf
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I've done something with the lua API
I've been learning about Lua, especially how it works, and I understand the stack method it uses to store things. Well, that's more or less what I understood from its documentation. Playing around with the API, I created something with SDL Mixer. It's basic for playing audio files, so I'm just learning. I'd like your feedback and recommendations. Feel free to contribute if you'd like. To the code. https://github.com/JuanPerdomo00/Laudio
https://redd.it/1nqhxdn
@r_lua
I've been learning about Lua, especially how it works, and I understand the stack method it uses to store things. Well, that's more or less what I understood from its documentation. Playing around with the API, I created something with SDL Mixer. It's basic for playing audio files, so I'm just learning. I'd like your feedback and recommendations. Feel free to contribute if you'd like. To the code. https://github.com/JuanPerdomo00/Laudio
https://redd.it/1nqhxdn
@r_lua
GitHub
GitHub - JuanPerdomo00/Laudio: Simple lib audio lua
Simple lib audio lua. Contribute to JuanPerdomo00/Laudio development by creating an account on GitHub.
blackscreen NUI fix.
FIVEM if you ever built a UI and are bashing your head against the wall with a backscreen that just wont go away here is the fix. Root cause: CEF (the Chromium wrapper FiveM uses) was compositing a fallback opaque layer behind your UI. If the page/body/background aren’t explicitly transparent, or if you use CSS effects that force a new compositing layer (backdrop-filter, heavy box-shadow, large border radii), CEF often draws a solid black rounded rectangle as the fallback.
What the fixes did:
Explicitly set body/html background to transparent so CEF knows to render game beneath the page.
Removed backdrop-filter and reduced/removed the heavy box-shadow so the browser didn’t create the extra opaque compositing layer.a
Used a semi‑transparent RGBA card color instead of relying on filters; that avoids forcing the opaque fallback.
Practical note: If artifacts persist after code changes, clear FiveM cache and restart the client because CEF can cache rendered frames.
https://redd.it/1nr9glu
@r_lua
FIVEM if you ever built a UI and are bashing your head against the wall with a backscreen that just wont go away here is the fix. Root cause: CEF (the Chromium wrapper FiveM uses) was compositing a fallback opaque layer behind your UI. If the page/body/background aren’t explicitly transparent, or if you use CSS effects that force a new compositing layer (backdrop-filter, heavy box-shadow, large border radii), CEF often draws a solid black rounded rectangle as the fallback.
What the fixes did:
Explicitly set body/html background to transparent so CEF knows to render game beneath the page.
Removed backdrop-filter and reduced/removed the heavy box-shadow so the browser didn’t create the extra opaque compositing layer.a
Used a semi‑transparent RGBA card color instead of relying on filters; that avoids forcing the opaque fallback.
Practical note: If artifacts persist after code changes, clear FiveM cache and restart the client because CEF can cache rendered frames.
https://redd.it/1nr9glu
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
love2D
I want to make a simple game with love2D, but I don't know how to use it, where can I find documentation for it?
https://redd.it/1nrjjru
@r_lua
I want to make a simple game with love2D, but I don't know how to use it, where can I find documentation for it?
https://redd.it/1nrjjru
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
What do you think about OOP in Lua?
Hi guys, I recently started to learning Lua, and pretty fast I learn almost everything, but only metatables, the most powerful Lua thing, left (and coroutines btw, but that's not the topic). And, using some meta-functions, you can basically create everything. Also I saw an example when you can create any object of type Person, and setup its parameters, like name, age etc. I don't understand yet what it actually doing to reach this, so I want to ask you: is OOP in Lua that comfortable like, for example, in C++ or Java?
https://redd.it/1nrnfro
@r_lua
Hi guys, I recently started to learning Lua, and pretty fast I learn almost everything, but only metatables, the most powerful Lua thing, left (and coroutines btw, but that's not the topic). And, using some meta-functions, you can basically create everything. Also I saw an example when you can create any object of type Person, and setup its parameters, like name, age etc. I don't understand yet what it actually doing to reach this, so I want to ask you: is OOP in Lua that comfortable like, for example, in C++ or Java?
https://redd.it/1nrnfro
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Are there any ways to use MoonGL in Lua 5.4?
I tried to install it but it didn't work because it only supported Lua 5.3. And I don't want to downgrade Lua for this
https://redd.it/1nrnu8y
@r_lua
I tried to install it but it didn't work because it only supported Lua 5.3. And I don't want to downgrade Lua for this
https://redd.it/1nrnu8y
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
(Luau) I'm having a problem with generating grass.
I am making static generating terrain that was originally from infinitely generating terrain (I got too lazy)
the problem is it's not generating grass no matter what I do. I am trying to return "grassland" back so It generates. I have left you with a lot of comments so you could find out what is what.
https://preview.redd.it/wizhiqi4dorf1.png?width=1211&format=png&auto=webp&s=b822c9336b1a74258a5272476cf97224db01ea74
https://preview.redd.it/ibhf2a61dorf1.png?width=872&format=png&auto=webp&s=07166d1eb54d33d7f065c67934ef19f3ac4f505b
https://preview.redd.it/6735rft1dorf1.png?width=534&format=png&auto=webp&s=ca10c468a1f48c8612a545b86816cb2abd672cf1
https://redd.it/1nrqr2d
@r_lua
I am making static generating terrain that was originally from infinitely generating terrain (I got too lazy)
the problem is it's not generating grass no matter what I do. I am trying to return "grassland" back so It generates. I have left you with a lot of comments so you could find out what is what.
https://preview.redd.it/wizhiqi4dorf1.png?width=1211&format=png&auto=webp&s=b822c9336b1a74258a5272476cf97224db01ea74
https://preview.redd.it/ibhf2a61dorf1.png?width=872&format=png&auto=webp&s=07166d1eb54d33d7f065c67934ef19f3ac4f505b
https://preview.redd.it/6735rft1dorf1.png?width=534&format=png&auto=webp&s=ca10c468a1f48c8612a545b86816cb2abd672cf1
https://redd.it/1nrqr2d
@r_lua
Macros / Inline Syntax and Text Replacement
Are there any good LUA transpilers that bring this functionality?
I think having your own syntax sugars would make the language even more powerful and intuitive as is. I'm working on my own solution running on a language server because i haven't found something sensible yet.
https://redd.it/1nrx4m4
@r_lua
Are there any good LUA transpilers that bring this functionality?
I think having your own syntax sugars would make the language even more powerful and intuitive as is. I'm working on my own solution running on a language server because i haven't found something sensible yet.
https://redd.it/1nrx4m4
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
If Minecraft was written in LuaJIT, would it be better or worse? (FFI is 100% available)
https://redd.it/1ntb1w2
@r_lua
https://redd.it/1ntb1w2
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Ok can you help me with that code ? Its for stormworks
Look my code is for stormworks it need to search a seat navigate and start shooting here is :scanAngle = 0
function onTick()
local tx = input.getNumber(1)
local ty = input.getNumber(2)
local tz = input.getNumber(3)
local hasPlayer = input.getBool(1)
local yaw, pitch
if hasPlayer then
scanAngle = scanAngle + 0.02
if scanAngle > math.pi then scanAngle = -math.pi end
yaw = scanAngle / math.pi
pitch = 0
output.setBool(3, true)
else
scanAngle = scanAngle + 0.02
if scanAngle > math.pi then scanAngle = -math.pi end
yaw = scanAngle / math.pi
pitch = 0
output.setBool(3, false)
end
output.setNumber(1, yaw)
output.setNumber(2, pitch)
end
https://redd.it/1ntitsq
@r_lua
Look my code is for stormworks it need to search a seat navigate and start shooting here is :scanAngle = 0
function onTick()
local tx = input.getNumber(1)
local ty = input.getNumber(2)
local tz = input.getNumber(3)
local hasPlayer = input.getBool(1)
local yaw, pitch
if hasPlayer then
scanAngle = scanAngle + 0.02
if scanAngle > math.pi then scanAngle = -math.pi end
yaw = scanAngle / math.pi
pitch = 0
output.setBool(3, true)
else
scanAngle = scanAngle + 0.02
if scanAngle > math.pi then scanAngle = -math.pi end
yaw = scanAngle / math.pi
pitch = 0
output.setBool(3, false)
end
output.setNumber(1, yaw)
output.setNumber(2, pitch)
end
https://redd.it/1ntitsq
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua 3D game engine
So long story short. I like Lua, I use it, I'm not the best but would like to make a game outside of Roblox. My features I'm looking for is just a simple 3D game engine where I can create a game, similar to GoDOT, Unity, and Love2D but Love is mostly just a 2D game engine idk if 3D games can easily be made with it, so I'd like to know if there's anything I can use that solves the 3D problem right away. Obviously there's roblox but I don't think I can export games casually like I can with GoDOT and Unity, and of course, while those are good engines, I really don't want to learn new noscripting languages right now.
\- Good 3D game engine that uses LUA
\- Doesn't have to have a big community
\- The engine has to export games easily into executable files
https://redd.it/1ntqadr
@r_lua
So long story short. I like Lua, I use it, I'm not the best but would like to make a game outside of Roblox. My features I'm looking for is just a simple 3D game engine where I can create a game, similar to GoDOT, Unity, and Love2D but Love is mostly just a 2D game engine idk if 3D games can easily be made with it, so I'd like to know if there's anything I can use that solves the 3D problem right away. Obviously there's roblox but I don't think I can export games casually like I can with GoDOT and Unity, and of course, while those are good engines, I really don't want to learn new noscripting languages right now.
\- Good 3D game engine that uses LUA
\- Doesn't have to have a big community
\- The engine has to export games easily into executable files
https://redd.it/1ntqadr
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How do I learn to code in lua?
Me and my friends are planning on making a roblox game and I don't know how to use lua, how do I learn? Also the people working on the game range from the ages 12-14 so is there any good way people our age can learn?
https://redd.it/1ntv4ur
@r_lua
Me and my friends are planning on making a roblox game and I don't know how to use lua, how do I learn? Also the people working on the game range from the ages 12-14 so is there any good way people our age can learn?
https://redd.it/1ntv4ur
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community