Sol + Enet
I want to call functions in the Lua state when a packet is received etc., but enet is currently on a separate thread to not hang the main thread. However, I have noticed a lot of memory problems that come from this. I've tried using mutex but nothing has been alleviated. Any guidance or perhaps different networking libraries I should consider?
https://redd.it/1jcd83l
@r_lua
I want to call functions in the Lua state when a packet is received etc., but enet is currently on a separate thread to not hang the main thread. However, I have noticed a lot of memory problems that come from this. I've tried using mutex but nothing has been alleviated. Any guidance or perhaps different networking libraries I should consider?
https://redd.it/1jcd83l
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Help me, Fivem server programmers.Problem on, Core.Lua
Can you help me? I'm having an error opening the phone on all servers in Fivem.
The error and this.
inventory/client-side/core.lua:52: No such export open in resource smartphone
https://redd.it/1jckfym
@r_lua
Can you help me? I'm having an error opening the phone on all servers in Fivem.
The error and this.
inventory/client-side/core.lua:52: No such export open in resource smartphone
https://redd.it/1jckfym
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How would I go about making walls give momentum
I'm currently making a game where movement and momentum are large parts of it, how would I go about making a momentum retaining wall system and or wall run system
https://redd.it/1jd2a34
@r_lua
I'm currently making a game where movement and momentum are large parts of it, how would I go about making a momentum retaining wall system and or wall run system
https://redd.it/1jd2a34
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
My "Bullet" doesn't deal any damage on collision.
So im trying to make a gun/blunderbuss in roblox and everything works just fine apart from the damage, i've tried a lot of things to fix it but nothing worked, someone help me Please.
This is the Script:
`local tool = noscript.Parent`
`local bulletsFolder = noscript.Parent:FindFirstChild("Bullets")`
`function createBullet(bulletPosition)`
`local Bullet = Instance.New("Part", bulletsFolder)`
`Bullet.CFrame = CFrame.new(bulletPosition)`
[`Bullet.Name`](http://Bullet.Name) `= "Bullet"`
`Bullet.Size = Vector3.new(0.1,0.1,0.1)`
`Bullet.BrickColor = BrickColor.new("Black metallic")`
`Bullet.Shape = Enum.PartType.Ball`
`Bullet.CanCollide = true`
`Bullet.Transparency = 0`
`Bullet.BottomSurface = Enum.SurfaceType.Smooth`
`Bullet.TopSurface = Enum.SurfaceType.Smooth`
`Bullet.Anchored = true`
`game.Debris:AddItem(Bullet, 10)`
`end`
`-- raycasting`
`noscript.Parent.Shoot.OnServerEvent:Connect(function(player, mousePosition)`
`local raycastParams = RaycastParams.new()`
`raycastParams.FilterDescendantsInstances = {player.Character}`
`raycastParams.FilterType = Enum.RaycastFilterType.Exclude`
`local raycastResult = workspace:Raycast(tool.Handle.Barrel.Position,(mousePosition - tool.Handle.Barrel.Position) * 300, raycastParams)`
`if raycastResult.Position then`
`createBullet(raycastResult.Position)`
`end`
`if raycastResult then`
`local raycastInstance = raycastResult.Instance`
`local model = raycastInstance:FindFirstAncestorOfClass("Model")`
`if model then`
`if model:FindFirstChild("Humanoid") then`
`if` [`raycastInstance.Name`](http://raycastInstance.Name) `=="Head" then`
`model:FindFirstChild("Humanoid"):TakeDamage(40)`
`else`
`model:FindFirstChild("Humanoid"):TakeDamage(20)`
`end`
`end`
`end`
`end`
`end)`
and this is the Local Script:
`local userInputService = game:GetService("UserInputService") --UIS`
`local player = game.Players.LocalPlayer --player`
`local mouse = player:GetMouse() -- mouse`
`local tool = noscript.Parent`
`local debounce = false`
`local ammo = 1`
`local MaxAmmo = 8`
`local reloading = false`
`local isEquipped = false`
`--Reloading`
`local function reload()`
`if reloading == false and isEquipped and MaxAmmo > 0 then`
`reloading = true`
`tool.Sounds["Gun Reload"]:Play()`
`task.wait(1.987)`
`ammo = 1`
`MaxAmmo -= 1`
`player.PlayerGui.AmmoGui.Frame.TextLabel.Text = "Ammo: "..ammo.."/"..MaxAmmo`
`reloading = false`
`end`
`end`
`--Bullet`
`local function createBullet()`
`local Bullet = Instance.new("Part")`
`Bullet.CFrame = CFrame.new(tool.Handle.Position, mouse.Hit.Position)`
[`Bullet.Name`](http://Bullet.Name) `= "Bullet"`
`Bullet.Size = Vector3.new(0.7,0.7,0.7)`
`Bullet.BrickColor = BrickColor.new("Black")`
`Bullet.CanCollide = true`
`Bullet.Transparency = 0`
`Bullet.BottomSurface = Enum.SurfaceType.Smooth`
`Bullet.TopSurface = Enum.SurfaceType.Smooth`
`Bullet.Shape = Enum.PartType.Ball`
`local bodyVelocity = Instance.new("BodyVelocity")`
`bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)`
`bodyVelocity.P = math.huge`
`bodyVelocity.Velocity = mouse.UnitRay.Direction * 300`
`Bullet.Parent = game.Workspace`
`bodyVelocity.Parent = Bullet`
`game.Debris:AddItem(Bullet, 3)`
`end`
`-- Shooting`
`tool.Activated:Connect(function()`
`if debounce == false and ammo > 0 and reloading == false then`
`debounce = true`
`ammo -= 1`
`createBullet()`
`tool.Shoot:FireServer(mouse.Hit.Position)`
`tool.Sounds["Gun Shot"]:Play()`
`player.PlayerGui.AmmoGui.Frame.TextLabel.Text = "Ammo: "..ammo.."/"..MaxAmmo`
`task.wait(1.978)`
`debounce = false`
`elseif ammo <= 0 and reloading == false then`
`reload()`
`end`
`end)`
`-- UIS Reload`
`userInputService.InputBegan:Connect(function(inputObject, isTyping)`
`if isTyping then return end`
`if inputObject.KeyCode == Enum.KeyCode.R then`
`reload()`
`end`
`end)`
`-- Equip
So im trying to make a gun/blunderbuss in roblox and everything works just fine apart from the damage, i've tried a lot of things to fix it but nothing worked, someone help me Please.
This is the Script:
`local tool = noscript.Parent`
`local bulletsFolder = noscript.Parent:FindFirstChild("Bullets")`
`function createBullet(bulletPosition)`
`local Bullet = Instance.New("Part", bulletsFolder)`
`Bullet.CFrame = CFrame.new(bulletPosition)`
[`Bullet.Name`](http://Bullet.Name) `= "Bullet"`
`Bullet.Size = Vector3.new(0.1,0.1,0.1)`
`Bullet.BrickColor = BrickColor.new("Black metallic")`
`Bullet.Shape = Enum.PartType.Ball`
`Bullet.CanCollide = true`
`Bullet.Transparency = 0`
`Bullet.BottomSurface = Enum.SurfaceType.Smooth`
`Bullet.TopSurface = Enum.SurfaceType.Smooth`
`Bullet.Anchored = true`
`game.Debris:AddItem(Bullet, 10)`
`end`
`-- raycasting`
`noscript.Parent.Shoot.OnServerEvent:Connect(function(player, mousePosition)`
`local raycastParams = RaycastParams.new()`
`raycastParams.FilterDescendantsInstances = {player.Character}`
`raycastParams.FilterType = Enum.RaycastFilterType.Exclude`
`local raycastResult = workspace:Raycast(tool.Handle.Barrel.Position,(mousePosition - tool.Handle.Barrel.Position) * 300, raycastParams)`
`if raycastResult.Position then`
`createBullet(raycastResult.Position)`
`end`
`if raycastResult then`
`local raycastInstance = raycastResult.Instance`
`local model = raycastInstance:FindFirstAncestorOfClass("Model")`
`if model then`
`if model:FindFirstChild("Humanoid") then`
`if` [`raycastInstance.Name`](http://raycastInstance.Name) `=="Head" then`
`model:FindFirstChild("Humanoid"):TakeDamage(40)`
`else`
`model:FindFirstChild("Humanoid"):TakeDamage(20)`
`end`
`end`
`end`
`end`
`end)`
and this is the Local Script:
`local userInputService = game:GetService("UserInputService") --UIS`
`local player = game.Players.LocalPlayer --player`
`local mouse = player:GetMouse() -- mouse`
`local tool = noscript.Parent`
`local debounce = false`
`local ammo = 1`
`local MaxAmmo = 8`
`local reloading = false`
`local isEquipped = false`
`--Reloading`
`local function reload()`
`if reloading == false and isEquipped and MaxAmmo > 0 then`
`reloading = true`
`tool.Sounds["Gun Reload"]:Play()`
`task.wait(1.987)`
`ammo = 1`
`MaxAmmo -= 1`
`player.PlayerGui.AmmoGui.Frame.TextLabel.Text = "Ammo: "..ammo.."/"..MaxAmmo`
`reloading = false`
`end`
`end`
`--Bullet`
`local function createBullet()`
`local Bullet = Instance.new("Part")`
`Bullet.CFrame = CFrame.new(tool.Handle.Position, mouse.Hit.Position)`
[`Bullet.Name`](http://Bullet.Name) `= "Bullet"`
`Bullet.Size = Vector3.new(0.7,0.7,0.7)`
`Bullet.BrickColor = BrickColor.new("Black")`
`Bullet.CanCollide = true`
`Bullet.Transparency = 0`
`Bullet.BottomSurface = Enum.SurfaceType.Smooth`
`Bullet.TopSurface = Enum.SurfaceType.Smooth`
`Bullet.Shape = Enum.PartType.Ball`
`local bodyVelocity = Instance.new("BodyVelocity")`
`bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)`
`bodyVelocity.P = math.huge`
`bodyVelocity.Velocity = mouse.UnitRay.Direction * 300`
`Bullet.Parent = game.Workspace`
`bodyVelocity.Parent = Bullet`
`game.Debris:AddItem(Bullet, 3)`
`end`
`-- Shooting`
`tool.Activated:Connect(function()`
`if debounce == false and ammo > 0 and reloading == false then`
`debounce = true`
`ammo -= 1`
`createBullet()`
`tool.Shoot:FireServer(mouse.Hit.Position)`
`tool.Sounds["Gun Shot"]:Play()`
`player.PlayerGui.AmmoGui.Frame.TextLabel.Text = "Ammo: "..ammo.."/"..MaxAmmo`
`task.wait(1.978)`
`debounce = false`
`elseif ammo <= 0 and reloading == false then`
`reload()`
`end`
`end)`
`-- UIS Reload`
`userInputService.InputBegan:Connect(function(inputObject, isTyping)`
`if isTyping then return end`
`if inputObject.KeyCode == Enum.KeyCode.R then`
`reload()`
`end`
`end)`
`-- Equip
function`
`tool.Equipped:Connect(function()`
`isEquipped = true`
`tool.Sounds["Gun Equip"]:Play()`
`mouse.Icon = "rbxassetid://"`
`player.PlayerGui.AmmoGui.Enabled = true`
`end)`
`tool.Unequipped:Connect(function()`
`isEquipped = false`
`mouse.Icon = "rbxassetid://"`
`player.PlayerGui.AmmoGui.Enabled = false`
`end)`
https://redd.it/1jdll70
@r_lua
`tool.Equipped:Connect(function()`
`isEquipped = true`
`tool.Sounds["Gun Equip"]:Play()`
`mouse.Icon = "rbxassetid://"`
`player.PlayerGui.AmmoGui.Enabled = true`
`end)`
`tool.Unequipped:Connect(function()`
`isEquipped = false`
`mouse.Icon = "rbxassetid://"`
`player.PlayerGui.AmmoGui.Enabled = false`
`end)`
https://redd.it/1jdll70
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Prosody 13.0.0 released - An XMPP/Jabber server written in Lua
https://blog.prosody.im/prosody-13.0.0-released/
https://redd.it/1jdpc7u
@r_lua
https://blog.prosody.im/prosody-13.0.0-released/
https://redd.it/1jdpc7u
@r_lua
blog.prosody.im
Prosody 13.0.0 released!
Welcome to a new major release of the Prosody XMPP server! While the 0.12 branch has served us well for a while now, this release brings a bunch of new features we’ve been busy polishing.
If you’re unfamiliar with Prosody, it’s an open-source project that…
If you’re unfamiliar with Prosody, it’s an open-source project that…
My If Statement only runs the First Block of code whether correct or not.
My If Statement will ignore any defined Variables, instead it will only run the first block of code. This code is the only code in the game (I am a beginner) and I am trying to make it work
local MyVarible = A
if MyVarible == B then
print("Incorrect IF")
elseif MyVariable == A then
print("Correct If")
end
Plz help. Thanks
https://redd.it/1jdtwpp
@r_lua
My If Statement will ignore any defined Variables, instead it will only run the first block of code. This code is the only code in the game (I am a beginner) and I am trying to make it work
local MyVarible = A
if MyVarible == B then
print("Incorrect IF")
elseif MyVariable == A then
print("Correct If")
end
Plz help. Thanks
https://redd.it/1jdtwpp
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
LuaRT - Windows programming framework
https://preview.redd.it/9e1upzpdg8pb1.png?width=494&format=png&auto=webp&s=49c295d5e8d9dcd3bf974b9afafc14d3fc6d21da
Lua^(rt) is a free, open-source programming framework built on Lua, designed for Windows application development and released under the MIT license I just released Lua^(rt) 1.9.5, and I think it's time to give you an update on the current status of the project.
What is Lua^(rt)
Lua^(rt) extends Lua -a language valued for its beginner-friendly syntax and simplicity- to create console and desktop applications on Windows. It includes runtime modules and tools to make development accessible for newcomers while supporting complex tasks with minimal effort.
Key Features
Beginner-Friendly: Lua’s straightforward syntax makes Lua^(rt) approachable for novices, while still enabling complex tasks—like crafting GUIs or handling web requests—with concise code.
Lightweight Runtime: The Lua^(rt) runtime is compact and self-contained, relying on no external libraries, ensuring minimal overhead and easy deployment.
Object-Oriented Programming: Lua^(rt) enhances Lua with robust OOP support, including multilevel inheritance, mixins, constructors, destructors, properties, and more, for structured and reusable code.
Asynchronous Programming: Lua^(rt) includes a
Batteries Included: Lua^(rt) contains lots of modules to cover most of today’s programming tasks, such as: json data parsing, audio playing and recording, clipboard access, Windows registry management, process control, compression, sqlite for database operations, C FFI module to call C functions from your Lua noscripts, and more ...
Enhanced UI Module: The
Theme Support: Adapts to Windows light/dark themes.
HighDPI support
WebView: Embeds WebView2 for displaying web content, and interact with it from Lua
Hardware-accelerated Direct2D rendering with the
Bundled Development Tools: Lua^(rt) comes with its own suite of tools:
Lua^(rt) Studio IDE: A dedicated environment for writing and debugging Lua^(rt) noscripts.
RTBuilder: A RAD (Rapid Application Development) tool for visually designing GUI applications.
rtc: A compiler to generate standalone executables with embedded content, simplifying distribution.
Documentation: A thorough guide (over 1,000 pages) covers modules, examples, and tutorials,...
Community Resources: A forum at https://community.luart.org provides a space for support and discussion, as well as a Discord server
Purpose and Use
Lua^(rt) leverages Lua’s ease of use and versatility for Windows programming, enhanced by modern features and development tools.
I built this framework to propose a coherent Lua ecosystem for Windows operating systems, aiming to simplify Windows development. It’s suited for beginners building their first apps or experienced users tackling advanced projects, and it’s open to feedback or contributions.
For more details, the official website is a good starting point. I’d be interested in hearing from anyone who tries it or has questions.
Regards,
Samir
https://redd.it/1je3niy
@r_lua
https://preview.redd.it/9e1upzpdg8pb1.png?width=494&format=png&auto=webp&s=49c295d5e8d9dcd3bf974b9afafc14d3fc6d21da
Lua^(rt) is a free, open-source programming framework built on Lua, designed for Windows application development and released under the MIT license I just released Lua^(rt) 1.9.5, and I think it's time to give you an update on the current status of the project.
What is Lua^(rt)
Lua^(rt) extends Lua -a language valued for its beginner-friendly syntax and simplicity- to create console and desktop applications on Windows. It includes runtime modules and tools to make development accessible for newcomers while supporting complex tasks with minimal effort.
Key Features
Beginner-Friendly: Lua’s straightforward syntax makes Lua^(rt) approachable for novices, while still enabling complex tasks—like crafting GUIs or handling web requests—with concise code.
Lightweight Runtime: The Lua^(rt) runtime is compact and self-contained, relying on no external libraries, ensuring minimal overhead and easy deployment.
Object-Oriented Programming: Lua^(rt) enhances Lua with robust OOP support, including multilevel inheritance, mixins, constructors, destructors, properties, and more, for structured and reusable code.
Asynchronous Programming: Lua^(rt) includes a
Taskobject for asynchronous operations, supporting async/await/after paradigms to simplify non-blocking code (e.g., running tasks in the background or scheduling delayed actions).Batteries Included: Lua^(rt) contains lots of modules to cover most of today’s programming tasks, such as: json data parsing, audio playing and recording, clipboard access, Windows registry management, process control, compression, sqlite for database operations, C FFI module to call C functions from your Lua noscripts, and more ...
Enhanced UI Module: The
ui module supports modern Windows features:Theme Support: Adapts to Windows light/dark themes.
HighDPI support
WebView: Embeds WebView2 for displaying web content, and interact with it from Lua
Hardware-accelerated Direct2D rendering with the
CanvaswidgetBundled Development Tools: Lua^(rt) comes with its own suite of tools:
Lua^(rt) Studio IDE: A dedicated environment for writing and debugging Lua^(rt) noscripts.
RTBuilder: A RAD (Rapid Application Development) tool for visually designing GUI applications.
rtc: A compiler to generate standalone executables with embedded content, simplifying distribution.
Documentation: A thorough guide (over 1,000 pages) covers modules, examples, and tutorials,...
Community Resources: A forum at https://community.luart.org provides a space for support and discussion, as well as a Discord server
Purpose and Use
Lua^(rt) leverages Lua’s ease of use and versatility for Windows programming, enhanced by modern features and development tools.
I built this framework to propose a coherent Lua ecosystem for Windows operating systems, aiming to simplify Windows development. It’s suited for beginners building their first apps or experienced users tackling advanced projects, and it’s open to feedback or contributions.
For more details, the official website is a good starting point. I’d be interested in hearing from anyone who tries it or has questions.
Regards,
Samir
https://redd.it/1je3niy
@r_lua
Possible error when compiling program
I'm writing an interpreter and i'm trying to have the output bytecodes be 1:1 with the official
g1, g2 = 1, 2
local up1, up2, up3, up4 = 11, 12, 13, 14
local print = print
local function foo()
local l1, l2 = 101, 102
l1, g1 = g2, l2
print(l1, g1)
-- assign to upvalues
up1, up2, up3 = l1, g1, up4
print(up1, up2, up3)
-- assign by upvalues
l1, g1, up1 = up2, up3, up4
print(l1, g1, up1)
local inner = function()
-- assign to upvalues
up1, up2, up3 = 101, g2, up4
print(up1, up2, up3)
end
inner()
end
foo()
main <testlua/chapter9/upvalues.lua:0,0> (13 instructions at 0x1433ecd0)
0+ params, 7 slots, 1 upvalue, 6 locals, 4 constants, 1 function
1 [1] VARARGPREP 0
2 [1] LOADI 0 1
3 [1] SETTABUP 0 1 2k ; ENV "g2" 2
4 1 SETTABUP 0 0 0 ; ENV "g1"
5 [2] LOADI 0 11
6 [2] LOADI 1 12
7 [2] LOADI 2 13
8 [2] LOADI 3 14
9 [3] GETTABUP 4 0 3 ; ENV "print"
10 23 CLOSURE 5 0 ; 0x1433f550
11 25 MOVE 6 5
12 25 CALL 6 1 1 ; 0 in 0 out
13 25 RETURN 6 1 1k ; 0 out
constants (4) for 0x1433ecd0:
0 S "g1"
1 S "g2"
2 I 2
3 S "print"
locals (6) for 0x1433ecd0:
0 up1 9 14
1 up2 9 14
2 up3 9 14
3 up4 9 14
4 print 10 14
5 foo 11 14
upvalues (1) for 0x1433ecd0:
0 ENV 1 0
function <testlua/chapter9/upvalues.lua:4,23> (35 instructions at 0x1433f550)
0 params, 6 slots, 6 upvalues, 3 locals, 2 constants, 1 function
1 5 LOADI 0 101
2 5 LOADI 1 102
3 6 GETTABUP 2 0 1 ; ENV "g2"
4 [6] SETTABUP 0 0 1 ; ENV "g1"
5 6 MOVE 0 2
6 7 GETUPVAL 2 1 ; print
7 7 MOVE 3 0
8 7 GETTABUP 4 0 0 ; ENV "g1"
9 [7] CALL 2 3 1 ; 2 in 0 out
10 [10] MOVE 2 0
11 [10] GETTABUP 3 0 0 ; ENV "g1"
12 10 GETUPVAL 4 5 ; up4
13 10 SETUPVAL 4 4 ; up3
14 10 SETUPVAL 3 3 ; up2
15 10 SETUPVAL 2 2 ; up1
16 11 GETUPVAL 2 1 ; print
17 11 GETUPVAL 3 2 ; up1
18 11 GETUPVAL 4 3 ; up2
19 11 GETUPVAL 5 4 ; up3
20 11 CALL 2 4 1 ; 3 in 0 out
21 14 GETUPVAL 2 3 ; up2
22 14 GETUPVAL 3 4 ; up3
23 14 GETUPVAL 4 5 ; up4
24 14 SETUPVAL 4 2 ; up1
25 14 SETTABUP 0 0 3 ; ENV "g1"
26 [14] MOVE 0 2
27 [15] GETUPVAL 2 1 ; print
28 [15] MOVE 3 0
29 [15] GETTABUP 4 0 0 ; ENV "g1"
30 15 GETUPVAL 5 2 ; up1
31 15 CALL 2 4 1 ; 3 in 0 out
32 21 CLOSURE 2 0 ; 0x1433fa70
33 22 MOVE 3 2
34 22 CALL 3 1 1 ; 0 in 0 out
35 23 RETURN0
constants (2) for 0x1433f550:
0 S "g1"
1 S "g2"
locals (3) for 0x1433f550:
0 l1 3 36
1 l2 3 36
2 inner 33
I'm writing an interpreter and i'm trying to have the output bytecodes be 1:1 with the official
luac using the 5.4.7 luac on the following program gives me these output luac -l -l -p test_lua/chapter9/upvalues.luag1, g2 = 1, 2
local up1, up2, up3, up4 = 11, 12, 13, 14
local print = print
local function foo()
local l1, l2 = 101, 102
l1, g1 = g2, l2
print(l1, g1)
-- assign to upvalues
up1, up2, up3 = l1, g1, up4
print(up1, up2, up3)
-- assign by upvalues
l1, g1, up1 = up2, up3, up4
print(l1, g1, up1)
local inner = function()
-- assign to upvalues
up1, up2, up3 = 101, g2, up4
print(up1, up2, up3)
end
inner()
end
foo()
main <testlua/chapter9/upvalues.lua:0,0> (13 instructions at 0x1433ecd0)
0+ params, 7 slots, 1 upvalue, 6 locals, 4 constants, 1 function
1 [1] VARARGPREP 0
2 [1] LOADI 0 1
3 [1] SETTABUP 0 1 2k ; ENV "g2" 2
4 1 SETTABUP 0 0 0 ; ENV "g1"
5 [2] LOADI 0 11
6 [2] LOADI 1 12
7 [2] LOADI 2 13
8 [2] LOADI 3 14
9 [3] GETTABUP 4 0 3 ; ENV "print"
10 23 CLOSURE 5 0 ; 0x1433f550
11 25 MOVE 6 5
12 25 CALL 6 1 1 ; 0 in 0 out
13 25 RETURN 6 1 1k ; 0 out
constants (4) for 0x1433ecd0:
0 S "g1"
1 S "g2"
2 I 2
3 S "print"
locals (6) for 0x1433ecd0:
0 up1 9 14
1 up2 9 14
2 up3 9 14
3 up4 9 14
4 print 10 14
5 foo 11 14
upvalues (1) for 0x1433ecd0:
0 ENV 1 0
function <testlua/chapter9/upvalues.lua:4,23> (35 instructions at 0x1433f550)
0 params, 6 slots, 6 upvalues, 3 locals, 2 constants, 1 function
1 5 LOADI 0 101
2 5 LOADI 1 102
3 6 GETTABUP 2 0 1 ; ENV "g2"
4 [6] SETTABUP 0 0 1 ; ENV "g1"
5 6 MOVE 0 2
6 7 GETUPVAL 2 1 ; print
7 7 MOVE 3 0
8 7 GETTABUP 4 0 0 ; ENV "g1"
9 [7] CALL 2 3 1 ; 2 in 0 out
10 [10] MOVE 2 0
11 [10] GETTABUP 3 0 0 ; ENV "g1"
12 10 GETUPVAL 4 5 ; up4
13 10 SETUPVAL 4 4 ; up3
14 10 SETUPVAL 3 3 ; up2
15 10 SETUPVAL 2 2 ; up1
16 11 GETUPVAL 2 1 ; print
17 11 GETUPVAL 3 2 ; up1
18 11 GETUPVAL 4 3 ; up2
19 11 GETUPVAL 5 4 ; up3
20 11 CALL 2 4 1 ; 3 in 0 out
21 14 GETUPVAL 2 3 ; up2
22 14 GETUPVAL 3 4 ; up3
23 14 GETUPVAL 4 5 ; up4
24 14 SETUPVAL 4 2 ; up1
25 14 SETTABUP 0 0 3 ; ENV "g1"
26 [14] MOVE 0 2
27 [15] GETUPVAL 2 1 ; print
28 [15] MOVE 3 0
29 [15] GETTABUP 4 0 0 ; ENV "g1"
30 15 GETUPVAL 5 2 ; up1
31 15 CALL 2 4 1 ; 3 in 0 out
32 21 CLOSURE 2 0 ; 0x1433fa70
33 22 MOVE 3 2
34 22 CALL 3 1 1 ; 0 in 0 out
35 23 RETURN0
constants (2) for 0x1433f550:
0 S "g1"
1 S "g2"
locals (3) for 0x1433f550:
0 l1 3 36
1 l2 3 36
2 inner 33
36
upvalues (6) for 0x1433f550:
0 ENV 0 0
1 print 1 4
2 up1 1 0
3 up2 1 1
4 up3 1 2
5 up4 1 3
function <testlua/chapter9/upvalues.lua:17,21> (12 instructions at 0x1433fa70)
0 params, 4 slots, 6 upvalues, 0 locals, 1 constant, 0 functions
1 19 LOADI 0 101
2 19 GETTABUP 1 3 0 ; ENV "g2"
3 [19] GETUPVAL 2 4 ; up4
4 [19] SETUPVAL 2 2 ; up3
5 [19] SETUPVAL 1 1 ; up2
6 [19] SETUPVAL 0 0 ; up1
7 [20] GETUPVAL 0 5 ; print
8 [20] GETUPVAL 1 0 ; up1
9 [20] GETUPVAL 2 1 ; up2
10 [20] GETUPVAL 3 2 ; up3
11 [20] CALL 0 4 1 ; 3 in 0 out
12 [21] RETURN0
constants (1) for 0x1433fa70:
0 S "g2"
locals (0) for 0x1433fa70:
upvalues (6) for 0x1433fa70:
0 up1 0 2
1 up2 0 3
2 up3 0 4
3 ENV 0 0
4 up4 0 5
5 print 0 1
shouldn't this line
https://redd.it/1je7b26
@r_lua
upvalues (6) for 0x1433f550:
0 ENV 0 0
1 print 1 4
2 up1 1 0
3 up2 1 1
4 up3 1 2
5 up4 1 3
function <testlua/chapter9/upvalues.lua:17,21> (12 instructions at 0x1433fa70)
0 params, 4 slots, 6 upvalues, 0 locals, 1 constant, 0 functions
1 19 LOADI 0 101
2 19 GETTABUP 1 3 0 ; ENV "g2"
3 [19] GETUPVAL 2 4 ; up4
4 [19] SETUPVAL 2 2 ; up3
5 [19] SETUPVAL 1 1 ; up2
6 [19] SETUPVAL 0 0 ; up1
7 [20] GETUPVAL 0 5 ; print
8 [20] GETUPVAL 1 0 ; up1
9 [20] GETUPVAL 2 1 ; up2
10 [20] GETUPVAL 3 2 ; up3
11 [20] CALL 0 4 1 ; 3 in 0 out
12 [21] RETURN0
constants (1) for 0x1433fa70:
0 S "g2"
locals (0) for 0x1433fa70:
upvalues (6) for 0x1433fa70:
0 up1 0 2
1 up2 0 3
2 up3 0 4
3 ENV 0 0
4 up4 0 5
5 print 0 1
shouldn't this line
24 [14] SETUPVAL 4 2 ; up1 be 24 [14] SETUPVAL 2 4 ; up1?https://redd.it/1je7b26
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
lua noscript
Hi I'm looking for someone who can write a trigger bot for FiveM as a Lua noscript. If you can do that and it works in the end, I would also pay for it.
https://redd.it/1jee7sz
@r_lua
Hi I'm looking for someone who can write a trigger bot for FiveM as a Lua noscript. If you can do that and it works in the end, I would also pay for it.
https://redd.it/1jee7sz
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Put png file in lua file is possible ?
Hello, I'm a graphic designer (so you're talking to someone stupid, who's probably going to ask stupid questions)
For a project, I need to put PNG files inside a LUA file, so as not to provide any external files other than the LUA file, but I don't know if this is possible (I hear everything and its opposite on the internet).
can someone can answer my question ? :/
https://redd.it/1jegkf5
@r_lua
Hello, I'm a graphic designer (so you're talking to someone stupid, who's probably going to ask stupid questions)
For a project, I need to put PNG files inside a LUA file, so as not to provide any external files other than the LUA file, but I don't know if this is possible (I hear everything and its opposite on the internet).
can someone can answer my question ? :/
https://redd.it/1jegkf5
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Help
So ive done a few LUA tutorials online (trying to learn it for ROBLOX game development) but i have learnt everything cant figure out how to make stuff. like for example, i know stuff about lua but i have no idea how to make something random that helps me practice. like i dont know how to actually noscript this stuff but i know the language idk if u guys can understand that but help pls
https://redd.it/1jey7b1
@r_lua
So ive done a few LUA tutorials online (trying to learn it for ROBLOX game development) but i have learnt everything cant figure out how to make stuff. like for example, i know stuff about lua but i have no idea how to make something random that helps me practice. like i dont know how to actually noscript this stuff but i know the language idk if u guys can understand that but help pls
https://redd.it/1jey7b1
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community