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
Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Get network connection status in neovim

Because of my work environment I'm actually working offline quite a bit, and I have some lsp configurations that I'm trying to toggle automatically based on my current network status. Is there a way ...
Andrew's user avatar
  • 80
0 votes
0 answers
13 views

ctrl + <del> or <backspace> won't delete a whole word in Neovim

problem: ctrl + <del> or ctrl + <backspace> doesn't delete a whole word. I know there's another way to do it in Neovim, but I want to change the current behaviour. So I tried changing my ...
phukon's user avatar
  • 51
0 votes
0 answers
15 views

How can I make the NPC shoot as soon as the raycast sees the player?

Currently, the way this script works is the NPC will move all the way to the players head position before they start firing. I want the NPC to check if the path to the player is unobstructed, and if ...
JCoder2002's user avatar
0 votes
0 answers
18 views

OreString not changing

local proximityprompt = game.Workspace.Tycoons.Tycoon.MainItems.Cardboard_Box.Box.ProximityPrompt local SellGui = script.Parent.Parent.Sell local StorageGui = script.Parent local x = script.Parent....
Sodz1aX's user avatar
0 votes
0 answers
8 views

How to create a lua filter that targets title slides in Quarto revealjs presentations

I'd like to build off of the answer in this question. I want to modify the background image of slides that meet a certain criteria. In this case I want to apply new attributes to the title slide and ...
kputschko's user avatar
  • 788
-2 votes
0 answers
22 views

Decryption of Lua Code: Seeking Assistance to Decode Encrypted Lua Script [duplicate]

I have a piece of Lua code that appears to be encrypted or obfuscated. I'm trying to understand the functionality of the code for analysis purposes, but I'm having difficulty in decoding it. Is there ...
apako's user avatar
  • 1
0 votes
0 answers
9 views

Add custom VSCode style snippets to NVChad

Using Neovim with NVChad. I have read the documentation but can't get it to work unless I add my custom snippets to the default friendly-snippets folder. According to the NVChad docs: -- vscode format ...
clockworkpc's user avatar
0 votes
0 answers
13 views

HAProxy Fails to Execute Lua Script Correctly and Cannot Detect Backend

I am attempting to implement a script to execute actions based on the state of my backend nodes. Below is the initial section of my lua script and also haproxy backend config Despite these settings, I ...
Manhal Mohammed's user avatar
0 votes
1 answer
26 views

How can I detect if the raycast hits the player in roblox studio?

local PathfindingService = game:GetService("PathfindingService") local Humanoid = script.Parent.Humanoid local Root = script.Parent.HumanoidRootPart local goal = script.Parent.Goal -- ...
JCoder2002's user avatar
0 votes
0 answers
26 views

Cannot read unicode from stdin from regular PS and CMD windows

--test.lua local s = io.read() for i=1, utf8.len(s) do local cp = utf8.codepoint(s,i) print(cp) print(utf8.char(cp)) end Run in a PowerShell terminal through the Terminal app: C:\>chcp ...
peterpop's user avatar
1 vote
1 answer
26 views

Apply key values to a dictionary from a dictionary

The title says it all. I want to do an operation to apply key values to a dictionary from a dictionary Here, I'll explain what I meant. I have these long dictionaries initialized in my code. local ...
mukeenanyafiq's user avatar
-2 votes
0 answers
14 views

What could be wrong with the g-hub script?

I use a very simple recoil script on g-hub, but in the past few days it has become much weaker than before. I didn't set anything on the mouse. I feel that the operation of the Sleep() line of code ...
Jirjo's user avatar
  • 1
0 votes
0 answers
21 views

isKeyPressed() function is not working for me

I am trying to write a script that executes a mouse movement when the character "f" on the keyboard is pressed but for some reason it doesn't work. Any suggestions? function test(event,arg) ...
ff f's user avatar
  • 1
1 vote
0 answers
18 views

Where does Neovim's Lua List type come from?

In Neovim's Lua, in addition to normal table objects, you can create List objects like so: x = [1, 2, 3] The documentation for lists is fairly straightforward. However, it doesn't seem like 'standard'...
wurli's user avatar
  • 2,516
2 votes
1 answer
33 views

Why does a roundtrip Lua UTC os.date -> os.time -> os.date result in an HOUR Time difference?

A roundtrip of os.date -> os.time -> os.date in UTC does not seem to get back to the same time: print(os.date( "!%a %b %d %H:%M:%S %Y")) print(os.date("%c" , os.time( os.date(...
MandoMando's user avatar
  • 5,325
-4 votes
0 answers
72 views

Reading and Writing game memory [closed]

hey this is my first time posting but basically ive just gotten into reading and writing memory of games specifically roblox because someone said it was a good starting place so I sat down and wrote ...
i_dont_know_what im doing 's user avatar
1 vote
1 answer
20 views

todo-comments.nvim: :TodoTelescope is searching for Todo comments in all of my files, not just the ones in the tree

I'm having some trouble using folke/todo-comments.nvim. The highlighting works great and all, but when I use <leader>st (my shortcut for :TodoTelescope), it is searching through all the files I ...
Pitore's user avatar
  • 15
0 votes
1 answer
22 views

trouble decompiling apk (not sure if it is called decompiling)

I have been trying to find the code of this game called House of the Lost for a long time. It is for a platform called the Ouya. I believe it was made using corona sdk. Also if you do manage to do it ...
user24330571's user avatar
0 votes
0 answers
23 views

Wrong key, Right key script in lua

I'm doing a prank ransomware program using AutoPlay Media Studio and the only script I did was this: Dialog.Message("A message from ElsaWare...","WRONG CODE! Didn't you pay to me?")...
Nazareno Pérez's user avatar
0 votes
1 answer
33 views

Roblox default animate script not working on NPC

So I'm trying to use the default Roblox "Animate" client side script on an NPC and when I try it, none of the animations load at all When I try to run the game with the code, nothing happens ...
Ministry Ray21's user avatar
0 votes
0 answers
28 views

Lua script that gives error with spaces in string

Title says it all. PROCESS_NAME = 'ProcessName_x64.exe' -------- -------- Auto Attach -------- local autoAttachTimer = nil ---- variable to hold timer object local autoAttachTimerIn = 1000 ---- Timer ...
Manuel Castro's user avatar
1 vote
0 answers
47 views

Simple yet incredibly frustrating lua pattern

I'm working with Luasnip, and for my latex setup I have some snippets that would make sense to run only if the previous character is a digit, a letter, or a curly brace. The digit and numbers work ...
Andrew's user avatar
  • 80
0 votes
0 answers
33 views

AstroNVim disable neo-tree sitter and replace it with nvim-tree or other

I've been trying out astroNVim works great but due to enterprise limitations i couldnt get neo-treesitter work for some reason and every time i save a file tree sitter crashes throwing a bunch of ...
Sudheej's user avatar
  • 1,961
0 votes
0 answers
17 views

Nvim lua cant require lua module with hyphens

So I am trying to create a plugin for nvim. The plugin gets the path and name of a certain module passed into a loader function. Now this works for modules where the module name does not have a hyphen....
DarkLSD_GuY's user avatar
0 votes
1 answer
32 views

Making a multiple stage selector in Roblox Studio

I'm making a stage selector that you can go forward and back a stage in my Roblox Game, but it didn't work, here's the code: local trasferHandler = {} local TOTAL_STAGES_IN_GAME = 10 for _, stage in ...
G4LC's user avatar
  • 1
0 votes
1 answer
27 views

How can I use lua language json.encode without breaking the order of the list?

I have a list like below in Lua, I send this list to the js side in json format using json.encode() code. But the problem is that the order of this list is changed by json.encode every time. So my ...
Mehmet Akgün's user avatar
1 vote
1 answer
47 views

How to remove function from "for" in Roblox Studio?

I have a code and I want the function to be on top, not in the loop itself. How do I do that? local blocks = workspace.test:GetChildren() for indx, obj in pairs(blocks) do obj.Touched:connect(...
user588818's user avatar
1 vote
1 answer
45 views

regex for the pattern of one optional space before Chinese words in lua

I tried use string.match("Í",'%s?[\u{4e00}-\u{9FFF}]+') which is similar to how we work in JS or others. But it will match one unnecessary character like the above 'Í'. The official ...
An5Drama's user avatar
  • 301
0 votes
0 answers
29 views

Running Java files with Neovim ide

I normally work on java projects and i recentely shifted to neovim from vscode, i have my lsp setup for java and everything but I cant run my files with just "java file.java" since i am ...
KhushPatibandha's user avatar
0 votes
1 answer
35 views

how would I convert a vim mapping to a neovim mapping?

I need vim for taking notes for math in highschool and I have a bind for vim to launch a script for making inkscape figures. inoremap <C-f> <Esc>: silent exec '.!inkscape-figures create &...
Wil Veasey's user avatar
0 votes
1 answer
29 views

attempt to compare Instance <= number Roblox Studio

Trying to make a basic buy system with a sword, I have 2 IntValues, one for the price of the object and another for the currency of the player. Idk what happens but the code doesn't work. Code of the ...
Gamer2VR's user avatar
-1 votes
1 answer
43 views

How do I use ldexp in lua 5.4 as math.ldexp(...) is deprecated

I am trying to write a uint32_to_float function in lua where I am using math.ldexp in a condition. Upon checking the script using luacheck, I get following error: scripts/CAN test.lua:58:21: ...
lonewolf's user avatar
2 votes
1 answer
38 views

Is there a way to split a string and preserve spaces in lua?

I have a table with strings like " item", " item". To render this items with indentation. I want a way to split this string and count how many spaces the string have on the ...
Vitor Lacerda's user avatar
0 votes
1 answer
53 views

Get the circle, that is defined by two points and tangent line, Lua

I've made a code to get the circle (or two circles) for given two points and tangential line. I am making the algorithm to make a circle with given two points and tangential linde for this circle. ...
darkfrei's user avatar
  • 405
0 votes
0 answers
13 views

neovim making snippets write in lua with nvim_set_keymap

i want to set keymap for lua to be sinppets for example: vim.api.nvim_set_keymap("n", "<leader>rs", ":call append(line('.'), [[welcome]])<CR>") and now i ...
Yossef Sabry's user avatar
0 votes
1 answer
22 views

Mta account char limit

In our Multi Theft Auto server, we want to give each player permission to create one character in the account creation part. We couldn't find any errors in the code we shared. In our SQL table, "...
Rahmi Efe Cömert's user avatar
0 votes
1 answer
65 views

String not changing

Idk why the orestring don't change when I write in script print(Orestring.Value) it normally works, it says that what should be in orestring but the orestring don't change local proximityprompt = ...
Sodz1aX's user avatar
1 vote
0 answers
26 views

Neovim treesitter setup issue in init.lua

This is my setup file: vim.cmd("set expandtab") vim.cmd("set tabstop=2") vim.cmd("set softtabstop=2") vim.cmd("set shiftwidth=2") vim.g.mapleader = " "...
in43sh's user avatar
  • 763
0 votes
2 answers
29 views

Apply leaderstat value on humanoid

I'm making a button increase leaderstat value of "Speed", then, apply that leaderstat value on to the WalkSpeed value of the players humanoid. (make them the same) Here's the thing. I've ...
Lane Bruns's user avatar
0 votes
2 answers
32 views

Need help sorting a Lua table

I am trying to sort this table by ID but I can't seem to figure it out, is there anyone out there that can assist me? Thank you in advance. Here is my code it basically grabs the item id as x and then ...
Josh Stevens's user avatar
0 votes
0 answers
22 views

Lua Scritp to detect Nmap scan

I was working with Lua scripts and trying to determine if there is any way to detect Nmap scanning using Lua scripts other than Suricata rules. What I've been able to deduce is to look for a ...
BuggyBugs's user avatar
2 votes
0 answers
28 views

Lua string.gmatch find empty fields between separators

I'm currently trying to convert a string into a table via separators. The separating itself works perfectly fine. In my example, I have two different separators. A ';' which leaves a string separated ...
milk's user avatar
  • 23
1 vote
1 answer
30 views

Nvim-cmp throwing error when expanding snippets

I have nvim-cmp installed and configured for Neovim. It works well and suggests code completion for all of my projects, until I recently noticed it throws an error and crashes with the Lua language. ...
JesseNoEyes's user avatar
0 votes
0 answers
15 views

Why is Premake5 not creating the necessary output directories for my project?

I'm using Premake5 as my build system for a C project on Windows. I'm using three scripts for my project: premake5.lua workspace "epoch" configurations { "Debug", "...
guyus15's user avatar
  • 101
-1 votes
1 answer
24 views

Players.ilippo.PlayerGui.ScreenGui.Storage.Script:15: attempt to index nil with 'Connect'

local proximityprompt = game.Workspace.Tycoons.Tycoon.MainItems.Cardboard_Box.Box.ProximityPrompt local StorageGui = script.Parent local x = script.Parent.Storage.Frame.X local Orebuttons = script....
Sodz1aX's user avatar
3 votes
1 answer
35 views

Why are some values disappearing?

I need to use a function that executes another function but adding an extra argument at the end, so I wrote this: function ExecuteWithMyNameAtTheEnd(f, ...) f(..., "Maxi") end ...
Maxi's user avatar
  • 33
-1 votes
1 answer
46 views

Making A Roblox Time Trial Obby and can't seem to make a timer in my format

I'm making a roblox time trials obby, but I can't make a timer in the format of 0:00s, any help ? i tried multiple times, but nothing worked I used a very basic script but the format looks quite ugly. ...
G4LC's user avatar
  • 1
0 votes
0 answers
19 views

MITRE ATT&CK Framework with Suricata

I've recently started working with suricata and don't have much experience with it yet. What I'm looking for is, If there's a way to configure suricata to be able to detect various MITRE ATT&CK ...
BuggyBugs's user avatar
0 votes
1 answer
35 views

Writing a protocol dissector with Lua does not autocomplete the Proto class

I am trying to look for a way to write a wireshark dissector. The problem is that I do not find a lot of documentation of how to do so, which is very weird for me. I installed Lua54 and I am writing ...
mimente1200's user avatar
1 vote
1 answer
30 views

This "CRIT" billboard GUI isn't working, how to fix it?

so the output says that Workspace.Knife.Script:58: attempt to index nil with 'Character' here is the code shown local player = game.Players.LocalPlayer local Character = player.Character local hum = ...
skisp's user avatar
  • 11

1
2 3 4 5
454