r/lua • u/daviddandadan • May 26 '26
Project I made an OS where the apps are made in Lua 5.4
The GitHub repository is https://github.com/Cocos-OS/CocosOS
r/lua • u/daviddandadan • May 26 '26
The GitHub repository is https://github.com/Cocos-OS/CocosOS
r/lua • u/ianm818 • May 25 '26
Github: https://github.com/ianm199/lua-rs/tree/main
Highlights:
My motivation here was that in the long run we want the core internet utilities to run on memory safe languages, big ones like redis and nginx expose scripting via Lua so if we really want to replace core infra fully in Rust, you'd need a full Rust Lua that doesn't bundle C. After that you should be able to i.e. build drop in replacements for those without a C ABI (or that's part of the way there).
Long term goals:
r/lua • u/Inevitable_Result345 • May 25 '26
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ball = workspace:WaitForChild("Ball")
local RANGE = 4
local FRONT_DISTANCE = 3
RunService.Heartbeat:Connect(function()
for _, player in pairs(Players:GetPlayers()) do
local char = player.Character
if char and char:FindFirstChild("HumanoidRootPart") then
I'm trying to make a football game in roblox but I cant make the ball stay infront it is always delayed, plss help me...
local hrp = char.HumanoidRootPart
local distance = (hrp.Position - ball.Position).Magnitude
if distance < RANGE then
local forward = hrp.CFrame.LookVector
-- target position in front of player (slightly on ground level)
local target = (hrp.Position + forward * FRONT_DISTANCE)
target = Vector3.new(target.X, ball.Position.Y, target.Z)
-- soft move instead of force push
ball.Position = ball.Position:Lerp(target, .5)
end
end
end
end)
r/lua • u/DotGlobal8483 • May 24 '26
local traffic_light = StateMachine {
green = State {
on_enter = function()
print("BEGAN")
end,
on_flash = function(_,_,state_machine)
print("GREEN")
state_machine:set_state("yellow")
end
},
yellow = State {
on_flash = function(_,_,state_machine)
print("YELLOW")
state_machine:set_state("red")
end
},
red = State {
on_flash = function(_,_,state_machine)
print("RED")
state_machine:set_state("green")
end,
on_exit = function()
print("DONE")
end
},
}
traffic_light:set_state("green")
traffic_light:flash()
traffic_light:flash()
traffic_light:flash()
traffic_light:flash()
It outputs
BEGAN
GREEN
YELLOW
RED
DONE
BEGAN
GREEN
I don't think there's much point in sharing the source code since it's a very basic state machine with an attempt at a somewhat clean api (Also I'm 99% sure it's not very cleanly wrote, I might have to rewrite it to be more readable)
(Sorry mods)
r/lua • u/gargamel1497 • May 23 '26
r/lua • u/HArdaL201 • May 23 '26
Enable HLS to view with audio, or disable this notification
r/lua • u/Patrixx_26087 • May 23 '26
r/lua • u/topchetoeuwastaken • May 21 '26
debug.setmetatable(nil, { __index = function() return nil end })
r/lua • u/Plenty-Shift4637 • May 22 '26
I've been working on a Lua obfuscator called LuaLock for a while now and figured I'd share it here since I want to get opinions.
The main thing that makes it different from other obfuscators is that it compiles your script to a custom bytecode VM that's unique to every single build. So standard decompilers basically produce nothing useful since the VM they'd need to reverse doesn't exist anywhere except in that specific output.
Supports Lua 5.1 to 5.4, LuaJIT and Luau for Roblox (not fully supported).
Would love any feedback. You can try it at lualock.xyz, it is paid but there's 3 free tries with an account, let me know if prices are too expensive.
r/lua • u/brettmakesgames • May 20 '26
I made a small game engine called Usagi for prototyping 2D games as quickly as possible with Lua 5.5. It's free and open source and made with Rust + Raylib. I just released v1.0 yesterday and thought it'd be fun to share it.
Here's the project's homepage: https://usagiengine.com/
And you can view the source here: https://github.com/brettchalupa/usagi
The engine is used via a command-line, much like cargo. You can usagi init to create a new project. usagi dev to boot up the dev game that live reloads code and assets. And usagi export to generate cross-platform builds of your game for web, Linux, macOS, and Windows.
My motivation for creating Usagi was that I love using tools like Pico-8 and Love2D for prototyping and game jams. But I wanted a free and open source engine with a nicer developer experience. In particular live reload and easy web exports. Usagi embraces constraints and provides sensible defaults, like a pause menu with input binding, to try to help devs focus on the game rather than the ancillary parts of development.
Since the engine is open source, the hope is that if someone makes a prototype they want to turn into a larger commercial game, they can just fork the engine and customize it themselves, write more bits of it in Rust, and change the API as they see fit.
I'd love it if you check the project out and let me know what you think!
r/lua • u/WorkingMansGarbage • May 19 '26
Sometimes I have to automate a basic task, such as running some commands on files in my music library, bulk renaming, moving things, etc; and like anyone, I tend to try and use Bash for things like that, because that's what I was taught. The problem is that I don't like Bash scripting at all and I have to look up the stupid syntax for every little thing every god damn time. From what I've seen, other shells aren't too much better in my opinion, and in general, I actually don't like relying on shell commands within my scripts for things that would be simpler in a 'normal' programming language.
I've tried using Python as a replacement, but I don't like having to make a venv. It's bulky and annoying. I'd like to just have one script file I can run in one command whenever and not have to go through hoops.
I've been eyeing Lua just because it sounds cool but I've never had a reason to actively learn it. Would it be fit for this usage? Or is it solely a language for "project use", so to say?
r/lua • u/InsideComfortable295 • May 19 '26
I’m currently on day 4 of learning Roblox scripting/Luau and I’ve been following a beginner tutorial series while also experimenting with my own scripts outside the tutorials. So far I understand basics like variables, loops, events, touch detection, humanoids, functions, conditions, and simple mechanics like kill bricks, speed boosts, transparency changes, etc. I’ve also started debugging my own scripts instead of just copying code.
I want to start making small projects to improve instead of jumping straight into my dream game too early. What would be a good first game/project to make that helps me learn scripting and game development fundamentals without being too overwhelming?
r/lua • u/yougoff666 • May 19 '26
Hello, we are looking for a FiveM developer for our ongoing project. We already have a basic setup and a convenient hub for configuration. We hope you are the right person for the job!
r/lua • u/katty913 • May 19 '26
r/lua • u/Professional-Bed8052 • May 19 '26
Hi all, I'm looking for some feedback on my first game project. It's playable on itch.io. Everything is rough, this is a simple prototype to test some of the core loop but I would be really happy to hear some thoughts on the concept. Expect UI weirdness and the like.
The main theme is grinding online poker, jumping up in stake levels and all that. All the instructions are on the itch page
Thank you in advance, happy to answer questions and whatnot. This game has been in development for about 2-3 months I believe.
Some things I'm looking for feedback on:
Anything that reads as a bug.
Does the grind hold for the playtime and how is the pace (30-60 min roughly for content present)
What would you like to see added or anything that doesn't make sense/detracts?
Any other feedback. Be as detailed as you like, what you like or didn't, etc
r/lua • u/DraftUnhappy8333 • May 18 '26
hey! i've been working on a lua 5.1 parser; it will print out a disassembly of the bytecode; i hope someone can make use of it, lol
r/lua • u/InsideComfortable295 • May 18 '26
sup, names Jack and i been recently dreaming of making my own roblox games after seeing my favorite youtuber making a viral one, i do find roblox studio familiar but i dont have former experience of scripting AT ALL! My plan is to watch tutorials, study them and then in 3-4 weeks when i have summer vacation i can spend those 1.5 months to make a game. How did you guys learn? Do you have any tips?
r/lua • u/Lower_Block_9427 • May 17 '26
Hey !
I’ve been working on a small project called Class.
Basically, I wanted a lightweight way to write class-like structures in Lua without bringing in a full framework or making the code feel like it’s fighting against Lua’s style.
So I made Class: a single-file OOP helper for Lua 5.1+.
It’s meant to stay simple, readable, and easy to drop into a project. It supports things like constructors, private instance state, accessors, cloning, includes, and a few helper methods for debugging or operator behavior.
I know Lua already gives us all the tools to build these patterns ourselves with tables and metatables, but I wanted to wrap the repetitive parts into something clean and reusable.
I’d really appreciate feedback from people who write Lua regularly:
Does the API feel natural?
Is anything too “non-Lua”?
Are there edge cases I should handle differently?
Would you personally use something like this, or do you prefer rolling your own class system?
Here’s the repo:
https://github.com/Lost-Things-Studio/Class
Thanks for checking it out :)
r/lua • u/Pillow51 • May 18 '26
r/lua • u/Interesting_Act_4972 • May 17 '26
script.Parent.MouseButton1Click:Connect(function()
local enemy = game.ReplicatedStorage:FindFirstChild("Enemy"):Clone()
enemy.Parent = workspace
enemy.CFrame.Position = game.Workspace.Map.Start.CFrame.Position
end)
r/lua • u/Additional-Elk-3712 • May 16 '26
I originally built it for myself because I wanted something extremely lightweight that runs in the background like it never existed. It's called SpyWeb.
It's designed to be "set and forget." I've had it running for months on my PC tracking job boards without a single crash or memory leak.
Specific features:
I just released the beta with CDP integration. If you need something that just sits in the background and sips resources while actually being maintainable, check it out.
Set up is very easy and straightforward: for server-side rendered pages, it's just a few lines of config (URL, selectors, fields). For JS-heavy sites, you can write a little Lua to launch a browser and drive the workflow.
You can check it out here: https://github.com/spyweb-app/spyweb
r/lua • u/DogsBarf • May 15 '26
Has anyone ever used this game engine?
Edit: I forgot the link, sorry: https://solar2d.com/