Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [lua]

Lua is a powerful, fast, lightweight, embeddable scripting language. It is dynamically typed, runs by interpreting bytecode, and has automatic garbage collection. Its speed is one of the main reasons it is widely used by the machine learning community. It is often referred to as an "extensible extension language".

lua
0 votes
0 answers
13 views

ClickDetector not detecting input

For some reason my Click Detector that I had put inside of my Local Script / Script (tried both) doesn't detect when it's clicked on. Does anyone know what causes this? Code: local ts = game:...
Relaxing Gaming's user avatar
0 votes
1 answer
20 views

How can I use a parameter to alter which data my profile.Data is accessing?

local expType = tostring(type1) local expTypeStat = expType:gsub("Exp", "") local profileDataExpType = "profile.Data."..expType Here I want to change ...
Lukas Raby's user avatar
1 vote
2 answers
38 views

Is it possible to Lua match string with an image name?

I got this script door = script.Parent function onChatted(msg, recipient, speaker) source = string.lower(speaker.Name) msg = string.lower(msg) -- thecharacter = script.Parent.TheCharacter if (msg ==...
RaZzA's user avatar
  • 11
1 vote
0 answers
20 views

Need the right flag, im not sure what it is

I'm a begginer in modding, specifically modding for The Binding of Isaac Repentance so Lua is new to me. The mod is supposed to upgrade your damage and size and lower your speed. Right now the dmg and ...
Alex_Vargas's user avatar
0 votes
1 answer
27 views

Lua Script for Reading CSV Produces Incorrect Output Format on Last Line

Issue Description I am writing a Lua script to read a CSV file and parse each line into a table. While processing the CSV file, I noticed that the output format of the last line is incorrect. Here is ...
Weijia Liu's user avatar
-4 votes
0 answers
28 views

Can sm1 help me and my friend with coding in roblox studio (lua) this is js for fun but we need help at like animations and a combat system type [closed]

we js need help with a combat system, and probably armour, we are not familiar with scripting on roblox studio We tried to make a combat system and it didnt turn out well, we need vfx, animations, and ...
Mason Goerke's user avatar
2 votes
1 answer
29 views

What's the advantage and disadvantage that using string.format("str", ...) instead of "str":format(...) in Lua?

I found a interesting problem in Lua. Lua provides string.format function to format the string, and the first parameter of this function is the string you want to format. Coincidentally, Lua allows :...
SHW's user avatar
  • 23
1 vote
1 answer
22 views

Movement problems in pong clone using lua LOVE engine

I'm new to LOVE and I'm trying to make a pong clone to get familiar with the engine. I made the first paddle move using .isDown, but for some reason the second paddle is moving too. Any help is ...
Θοδωρής Ψυχογιός's user avatar
0 votes
1 answer
20 views

Lua: How to load/install module json?

I try to use JSON in Lua - I am completely new to Lua. My code (test.lua) local json = require ("json") print "hello" My install (Debian 12) # luarocks install luajson Installing ...
chris01's user avatar
  • 12k
1 vote
1 answer
29 views

Exp bar Gui not updating roblox studio

I have set up a basic exp system with exp, levels, and a Gui. I have the gui set to update when joining, and when gaining exp or a level, but it will only update when joining even though I'm using the ...
Lukas Raby's user avatar
0 votes
0 answers
25 views

Freeswitch Lua API - how to get Channel State?

Using Freeswitch, I am desperately trying to get the channel Call State value in Lua. The Lua script is executed by posting an HTTP request to Verto.. This is the Lua code I have, so far: api = ...
scharrua's user avatar
0 votes
1 answer
24 views

I am attempting to pass an infobox value into a LUA module that outputting an answer based on the infobox value (FANDOM WIKIA)

I am working on a module that converts the value of a specific value into a new value when mutliplying it by a certain percentage. EX 100 * 1.3754 = 137.54. When I use the module, it spits out my ...
John's user avatar
  • 33
1 vote
0 answers
28 views

Work-around for co-socket api's not being available in log_by_lua giving 404 error

I've been banging my head on this problem for a few days now, and have gotten a bit stuck, so I thought I'd ask here. Would really appreciate any help. Context: The issue that I'm currently facing ...
Arman Jasuja's user avatar
-1 votes
0 answers
27 views

custom lua_Alloc: Segmentation fault

I want to replace the realloc perf_state.orgAlloc = lua_getallocf(L, NULL); lua_setallocf(L, cst_lua_Alloc, NULL); static void *cst_lua_Alloc(void *ud, void *ptr, size_t osize, size_t nsize) { ...
pea's user avatar
  • 1
1 vote
1 answer
85 views

Building Visual Studio solution with C and C++

I'm wondering if I can add a C file to a C++ project. I use premake5 and conan to get the dependencies and build the solution but every file I've used so far is C++. Now, I need a C file that has a ...
agutier2's user avatar
-3 votes
1 answer
58 views

How to write a float hex literal in GLSL? [closed]

I'm trying to use lua gsub to modify a shader file for modding needs: content = ModTextFileGetContent("data/shaders/post_final.frag") ModTextFileSetContent("data/shaders/post_final.frag&...
ImmortalDamned's user avatar
0 votes
0 answers
21 views

redis lua script can't call on global

local function get_cur_time() local current_time = redis.call('TIME')[1] local current_minute_start = math.floor(current_time / 60) * 60 return current_minute_start end -- add below line ...
Mithril's user avatar
  • 13.5k
1 vote
0 answers
43 views

Lua scripting being used in mouse macro. (logitech)

I have a Lua script for Logitech G Hub that moves my mouse for me. It's set to use MB4 for that. I want to remap MB5 to press shift, mb4. But when I have the script running and press MB5, it only ...
newguy's user avatar
  • 11
0 votes
0 answers
32 views

Lua: Assistance Needed in Using Inheritance in conjunction with case-insensitive metatables/metamethods? Doable?

I've been trying to wrap my head around utilizing inheritance with Lua (https://www.lua.org/pil/16.2.html and Case insensitive array in Lua as references) but also integrating a case-insensitive ...
Spiderkeg's user avatar
0 votes
0 answers
13 views

Ghub buggy on g600?

I recently discovered the world of lua and I'm testing simple macros to improve the language. When I discovered that GHUB uses lua to make scripts, I tried to do something simple to hold recoil in any ...
Zend's user avatar
  • 1
0 votes
0 answers
42 views

Premake5 - cppdialect is ignored while creating project for VS2022

I'm trying to compile Sciter from a command line batch, using the Visual Studio 2022 compiler. For that reason I need to generate the VS2022 projects using Premake5. However Sciter needs to be ...
Jean-Milost Reymond's user avatar
2 votes
0 answers
31 views

Can I change the default hash function?

I is possible to change the default hash function that lua (or luajit) uses for the HashTable part of a talbe ? I want to speedup table access in pure Lua. I saw that: The Default hash function for ...
Benjamin V's user avatar
2 votes
0 answers
36 views

Neovim BiomeJS not using biome.json formatting

My lsp.lua is as follows: local util = require("lspconfig.util") return { { "williamboman/mason.nvim", opts = function(_, opts) vim.list_extend(opts....
Owenn's user avatar
  • 1,080
0 votes
0 answers
14 views

Img loading error | GLua | Garrys mod HUD

I can't add an image to my HUD in GLUA. I've tried to do it in the code, and I think it should work, but it doesn't. I have the correct type of image and its format. Folders hud |---lua | |---...
ART0022VI's user avatar
0 votes
1 answer
26 views

My Script inside my model's part doesn't run when I clone it

This is my code for spawning in the model itself which is located in ReplicatedStorage, which this is the hierarchy: SpawnDoor (Model) Door (Sound) Light (Folder) Door1 (Part) Door2 (Part) Part (Part) ...
Sergei Ivlev's user avatar
-4 votes
1 answer
61 views

What does index nil mean? [closed]

I attempted to mess around with the children because I think that's the problem but I was unsuccessful local tycoon = script.Parent.Parent local mainItems = tycoon:FindFirstChild("MainItems"...
RandomCoder's user avatar
0 votes
1 answer
28 views

How can I run the Wikipedia Module Yesno.lua from the lua cli?

Wikipedia has lua modules. One of them is the Yesno module. Its Yesno.lua file has these contents. return function (val, default) -- If your wiki uses non-ascii characters for any of "yes&...
gettimothy's user avatar
1 vote
1 answer
32 views

How to Apply the Same Skin to All Players in Roblox?

I am experimenting in Roblox Studio, and I want to create a logic that would give all players the same skin. (All players must look the same during gameplay.) I found two options: First option: Drag ...
Stalker's user avatar
  • 13
-4 votes
0 answers
79 views

I am currently trying to develop a Roblox game;, would somebody be able to help me with locate a module?

This is a module script, it is in ServerScriptService: local PlayerDataHandler = {} local dataTemplate = { Race = "", Cash = 0, Inventory = {}, Level = 0, } local ...
Sergei Ivlev's user avatar
0 votes
1 answer
71 views

Inline conversion of headers from RTF to HTML with Pandoc

I have an rtf file that, ultimately, I want to convert into a chunked html, splitting on the level 1 headings. My first step is to convert the rtf to one html file, which is straightforward with: ...
Packwood's user avatar
  • 287
0 votes
0 answers
21 views

My animation within Roblox Studio plays, HOWEVER in an actual game it doesn't play, but the projectile works

My Problem is that the animation I labelled as "FireballThrow" and the fireball projectile does play in the Roblox Studio environment, HOWEVER in a real game it doesn't execute properly, ...
Nafis's user avatar
  • 1
0 votes
0 answers
23 views

Error parsing config from lua tables in boost unit test

Config file are read from my project directory, each of them run normally when I execute the main project target. I have an issue running a test case. I'm using sol2 from here as the lua-managing ...
SagunKho's user avatar
  • 1,033
2 votes
1 answer
67 views

Lua table.sort invokes the comparing function with the same element

I have stumbled upon a strange behavior of table.sort(), in which the comparing function is invoked by passing the same array element in both parameters. Consider the code below. I want to sort the ...
Claudi's user avatar
  • 5,346
-1 votes
2 answers
48 views

How to maximize wezterm on startup?

Originally closed here https://github.com/wez/wezterm/issues/284 I could not get any of the solutions in the thread or the docs to work correctly in conjunction with config.window_decorations = "...
Daniel Lizik's user avatar
  • 3,104
1 vote
0 answers
30 views

neovim + lua + slimv: how to start swank server in the current folder/project?

I'm using Slimv with NVim, and it works perfectly except when attempting to (load ...) files from the same folder. I presume it's an issue with translating vim shell commands (with % expansions, etc.) ...
Tsarko's user avatar
  • 23
4 votes
2 answers
86 views

Is there a way to use <const> inside a Lua table?

Since Lua 5.4, the <const> syntax lets us set const variables. I noticed that this doesn't transitively affect fields inside a table. local x <const> = { a = {1,2,3}, b = {5,6,7} } ...
rbv's user avatar
  • 467
0 votes
0 answers
31 views

using tokens when including files

I'm trying to use include along with the token premake5: include "%{wks.location}/BuildSystemDependencies/UNIX/MacOS/Dependencies.lua" file tree: ├── BuildSystemDependencies ├── LICENSE ├── ...
RobY's user avatar
  • 13
0 votes
0 answers
23 views

Client is not receiving anything of data in my chat app

I am creating a chat app and want a server to broadcast every message that a client sends it, but the client is receiving no data after the server broadcasts the client message. I am using Lua lanes ...
cosmic coder's user avatar
-1 votes
1 answer
40 views

Can nginx's njs (or Lua?) be used to replace a header with that header's SHA-512?

I need to replace one log field, from nginx.conf, with its SHA-512 hash, for security reasons. I'd prefer to do this with njs, but would consider Lua. However, the only way I know of to modify a log ...
dstromberg's user avatar
  • 7,059
-1 votes
0 answers
65 views

Input order of points changes the outcome of Delaunay Triangulation

Recently I have learnt about the Delaunay Triangulation and using the Bowyer-Watson algorithm to solve it. When implementing, I followed along from the wikipedia pseudocode and other sources to create ...
Thomasssb1's user avatar
0 votes
0 answers
40 views

Script not detecting when a player with a set ID joins. Luau

For some reason a simple script that I wrote, that should call a function whenever a player joins, which after that checks if the players ID is one of the either. game.Players.PlayerAdded:Connect(...
Relaxing Gaming's user avatar
0 votes
0 answers
25 views

Is there a way to detect if local players character is touching the hitbox instead of the victim? Luau

Main question for me is can I make it so that it can access the local players character from a variable given in a module script? I can't seem to access the character of it, even though it still IS ...
Relaxing Gaming's user avatar
0 votes
0 answers
16 views

Can`t get constraint.HasConstraints working in Lua gmod

I`m writing a gmod lua script which checks if there are constraints for prop spawned by user (like ropes), but it always return false even if I spawn constrained props if SERVER then hook.Add(&...
Тимур Сенников's user avatar
0 votes
0 answers
43 views

Prevent duplication entry based on amount

So I'm writing an inventory for a game in lua, but I have some issues when it saves the inventory. The function code is as follows function SaveInventory(source, offline) local source = source ...
Avanae's user avatar
  • 21
0 votes
0 answers
70 views

Lua function: 'type', recreated in Luau

I need help with CheckType. How can I make it check: Enum. (Enum is a userdata, but it doesn't work; Enum is in Luau.) (This is me asking for help in the Language: Luau (Roblox)) When I test Enum, it ...
Valkyrie's user avatar
0 votes
1 answer
84 views

How to combine two logitech scripts?

Im trying to put the following 2 scripts together so that they can run at the same exact time. function OnEvent(event, arg) if EnableRCS ~= false then if IsMouseButtonPressed(3) then -- ...
censori's user avatar
2 votes
1 answer
63 views

Passing arguments through a RemoteEvent in Roblox

I'm currently trying to make a message system in Roblox. The server should be able to send a message via a RemoteEvent, and the client should be able to accept it by displaying the message on a GUI ...
Robin Bubeník's user avatar
0 votes
0 answers
38 views

Basketball not bouncing properly in Lua in Roblox Studio (I am making a game in Roblox Studio)

As the title clearly suggests, I am making a basketball game in roblox so I have recently been trying to make my basketball part, named "B-Ball" bounce in a continuous motion. This can be ...
Bro Ski's user avatar
0 votes
1 answer
49 views

Stamina bar going from 100 to 0 for no reason, Stamina value not getting any interactions

For some reason whenever I launch my experience, like a second or a half passes and the bar goes from full to empty. I also can't make any interactions with the value. (example: whenever I try to make ...
Relaxing Gaming's user avatar
0 votes
0 answers
40 views

Does executing a Lua script in Redis block the entire Redis server or just the database being accessed?

Details: Atomic Operations: I understand that Lua scripts in Redis are executed atomically. However, I need clarification on whether the atomicity affects only the Redis database being accessed by the ...
Gokulraj S's user avatar

15 30 50 per page
1
2 3 4 5
457