Most voted "lua" questions
Lua is a fast and lightweight scripting language designed to extend applications. It is typed dynamically, interpreted from bytecodes, and has automatic memory management with incremental garbage collection. Its features make Lua an ideal language for configuration, automation and rapid prototyping. (visit lua.org).
Learn more…203 questions
Sort by count of
-
1
votes1
answer647
viewsCan someone explain to me what is a Gothic Moon tie?
I already know the bonds while,repeat and for,but when I was seeing the types of loops, for generic" . The text was in English.
-
1
votes1
answer50
viewsBand operation with 64 bits
I know that on Moon 5.3 (demonstration) there are 64 bit operators, such as: print(0xaaDbc4Cd17Af & 0xff00000000) --> DB 00 00 00 00 Is there an algorithm to perform a similar operation in…
-
1
votes1
answer51
viewsIs there any way to modify what the module will return in Lua?
I want to know if it exists since I have a data storage system, in which the data stays in a table and when the player enters,this data is stored in a module script (The only one that returns…
-
1
votes1
answer142
viewsIs there a table breaker in Lua?
I’m wondering this because I want to know if one table is the same as another, if it’s an empty table or something.
-
1
votes1
answer66
viewsHow to decrease processing on the moon? or Muti hash?
I have a table with several 5 position Tables where the first two are the position in a Cartesian plane. --Table with water collors colors =…
-
1
votes1
answer252
viewsConcatenate variable names with numbers in Lua
I have a problem, I need to do the following: I have a variable that stores a number (x=3 for example) And I have a chart like this: tabela={} tabela.var1='teste1' tabela.var2='teste2'…
luaasked 6 years, 4 months ago Leonardo de Souza 13 -
1
votes1
answer388
viewsHow to read a file in the same script directory using Lua
I’m trying to make a small script, but I’m facing some difficulties local lab = nil local f = io.open("/input-lab.txt", "r") print(f) I wanted to open a file that is in the same directory as the…
-
1
votes1
answer58
viewsHow do I make a command with substring?
How do I substring with a command (ultilizing io.read)? example: io.read() question I say, Say Hello World then the console "printa" "Hello World". "Say" is the command "Hello World" is the…
-
1
votes0
answers55
viewsTranslation of Values for Letters in Lua
I was trying to create a function in moon that serves for the user to write in the terminal, I am using a modified version of the moon so I need that when the keyboard sends me the key code pressed…
luaasked 5 years, 3 months ago Rafael Longhi 11 -
1
votes1
answer174
viewsHow to add directories to search for modules in Lua?
I’m having a problem with require function, I want her to look for a moon file, but I don’t want to specify the folder, and my moon is installed on another disk, I’ll put a photo to see the error As…
-
1
votes1
answer56
viewsUse what the user type (io.read) as a function argument in Lua
I have the following function: function perfil(monstro) print(monstros.monstro.nomeM) print(monstros.monstro.racaM) print(monstros.monstro.generoM) print(monstros.monstro.idadeM)…
luaasked 4 years, 9 months ago Emperor Fakoed 21 -
1
votes0
answers85
viewsMOON: How to call a Function inside the loop and not pause it
I am facing a problem in a code that I am doing and the fact that I have learned for myself and in the bush I can’t deal with this problem. Everything happens because I want to call a function and…
-
1
votes0
answers60
viewsModule not located - "module xxx not found" - Lua lang
Archive: Player.lua, my module local Player = {} local function funcPlayer() local player = {} local self = {name="", points = 0} local setPoints = function(newPoints) self.points = newPoints end…
-
1
votes0
answers38
viewsReferencing specific values in an array . lua
In that case I created a math.random with the values from 1 to 2 that will lead me to a coordinate of a specific delivery. I created a table with the corresponding values. But since then I can’t get…
-
1
votes1
answer14
viewsHow do I use a Remote Event for two things?
I’m trying to remake a power game on Roblox, I’m using an old Uncopylocked place as a base, and everything there is non-fe. I wanted to use only one remote event for several codes (since they are…
-
1
votes2
answers47
viewsProblem when I try to import my own modules into Lua (not found)
In the main file.lua: local calculadora = { somar = function(x, y) return x + y end } function calculadora.multiplicar(x, y) return x * y end return calculadora In the Copyofmain file. local…
-
0
votes0
answers179
viewsBinary for text
I’m trying to read a binary value from a table, but I can’t get what I want. On the moon, is there any way to convert binary content to text? mysql database. I’m trying the following command:…
luaasked 10 years, 1 month ago Gabriel Sales 1,257 -
0
votes0
answers97
viewsCreate DLL from files
I have some files .lua with functions and would like to create a DLL with all the files, it is possible?
-
0
votes0
answers47
viewsDigital TV with Stickers
I don’t know if I can post it here. but I think so. What is happening is the following I have to do my article, and my advisor gave me the theme Development of Apps for digital TV using stickers. I…
-
0
votes1
answer2193
viewsHow to install the moon via terminal in Ubuntu?
How to install the moon via terminal in Ubuntu? When I try apt-get install lua is returned O pacote lua é um pacote virtual fornecido por: lua5.1 5.1.5-5ubuntu0.1 lua50 5.0.3-7 lua5.2 5.2.3-1…
-
0
votes0
answers337
viewsVector ordering
I’m learning about vectors and matrices, and I haven’t been able to solve a question in the right way for a long time. The statement says: Given some vector, sort it in sequential (numerical).…
-
0
votes1
answer172
viewsWhen to use a scripting language?
When to use a language of script and what is the ideal setting for its use? I’ve been reading about languages script and I thought about the possibility of using them in my C/C++ project for a game…
-
0
votes0
answers99
viewsDetect Collision and React moon game
I wanted help with 2d square collision and how to prevent the character from passing through the block Follow the player code: local player = nil Player = {} player_skins = { human =…
-
0
votes1
answer54
viewsWhere can I download the Hump library?
On my American Stack Overflow account,I asked how I could make the game wait a certain number of seconds. One of the results was using Hump.timer, for example: function love.load() timer=require…
luaasked 7 years, 11 months ago arthurgps2 411 -
0
votes1
answer82
viewsIs there a way to stop a Tweening in ROBLOX studio?
I want a command that stops a Tweening in ROBLOX studio, for example: frame:TweenPosition(UDim2.new(0, 200, 0, 0), "Out", "Quad", 1) But when receiving some condition, there is some way to stop this…
luaasked 7 years, 11 months ago arthurgps2 411 -
0
votes0
answers205
viewsIs there a text editor that integrates with Github?
I’m using Notepad++ to program in the Lua language (small programs, I’m still studying), and I usually save the codes on Github when I have to stop to continue afterwards. But manually I need to go…
-
0
votes1
answer45
viewsHow do I wait until a condition is given in LOVE2D?
I’ve already tried timer=require'hump.timer' timer.script(function(wait) repeat wait(0) until condição but it didn’t work.I even tried to remove the wait,but the game crashed.Please help me!!!…
luaasked 7 years, 11 months ago arthurgps2 411 -
0
votes1
answer200
viewsHow do I trigger a remote Event for the server and client in the same script in ROBLOX Studio?
I’ve already tried remoteEvent:FireAllClients() remoteEvent:FireServer() but it didn’t work. It said that FireServer could only be used by the client. I also tried: --No server script em workspace…
-
0
votes1
answer187
viewsHow to declare "strings" accented strings?
Lua is written in C logo shares the American Standard Code for Information Exchange "ASCII" Accepts matrix key declaration with accent: rafael = {} rafael["é"]="eu" print(rafael["é"]) --saída: eu…
-
0
votes1
answer363
viewsHow to run scripts in Lua with java program?
I want to learn how to develop, combining more than one programming language, using java with scripts in moon.
-
0
votes1
answer113
viewsRemove element/function Corona SDK
have file form.lua with the code: local _M = {} function _M.calc( a ) local quad = display.newRect(100,100,100,100) end return _M and the file scene2.lua with the code: local form = require "form"…
luaasked 6 years, 10 months ago Thiago Miranda 21 -
0
votes1
answer105
views -
0
votes1
answer116
viewsLua has static and dynamic variables in the heap?
Does the storage binding (related to the variable’s lifetime) allow static variables? Allows dynamic variables of heap?
-
0
votes0
answers56
viewsLoop for was supposed to run 5 times, but runs only 1
So I’m having a problem with a loop for in the code below: for i=1,#collisionBlocks do t=collisionBlocks[i] print(#collisionBlocks) print(i) if player.y-1<t[4] and player.y-1>t[2] and…
-
0
votes1
answer95
viewsNames and data types Lua
About names and data types in the Lua language. What is the maximum size of a name? Is the definition of Enumeration, Subrange, Registration and Union types allowed? I did not find this information…
-
0
votes1
answer226
viewsWhat is the code you made for Lua’s print() and io.read() function?
What is the code they made for the function print() and io.read() of the Moon, I want to make a programming language so I need to know.
-
0
votes1
answer1161
viewsHow to find a file without specifying folder/drive in bat or moon?
How to find a file and save it in a variable? I will use it for reading (this part is already solved), however, I want to locate without specifying folder/drive, for example .\Arquivo.txt. I’ve…
-
0
votes1
answer146
viewsHow to install moon in Ubuntu via terminal?
I have tried everything, write apt-get install lua5.1 or lua5.2, it says it is impossible to find package Reading Package Lists... Ready Building a dependency tree Reading status information...…
luaasked 5 years, 1 month ago Arthur Gomes 1 -
0
votes1
answer37
viewsModified Linux kernel build error
I am trying to compile a modified version of the linux kernel (Xdplua). I followed the steps present in the Arch wiki (because I use Manjaro)…
-
0
votes1
answer29
viewsLua / Love2d: Error when trying to give require.Tree("code") : Attempt to index global 'require' (a Function value)
Error when trying to give require.Tree("code") : Attempt to index global 'require' (a Function value) function love.load() lib = require.tree("code") end being code a folder with files . moon inside…
-
0
votes1
answer66
viewsHow to read or run other files and programs with Lua?
Is there any file system(fs) in Lua? Any way to run JS files on Lua?
luaasked 4 years ago Nexus Prime 25 -
0
votes1
answer60
viewsError in Lua with LOVE2D
I’m having a problem with a code in Lua with LOVE2D. I’m trying to recreate the "game of the little snake" and I have a problem with the setupScreen function in love.load The code is like this:…
-
0
votes0
answers26
viewsLöve 2D stopping responding at start | Moon
I’m trying to use Löve 2D, I started creating a game where eyes follow the mouse. But always when I try to play the show, it stops responding. And not only in my code, the executable in the LOVE…
-
0
votes1
answer58
viewsI need help a file. Moon
I have recently been "learning" mecher with programming, but I’m still very lay. And recently I developed a HUD where I play, but I’d like to change the string format. his. local function…
-
-1
votes1
answer220
viewsHow can I remove all spaces from a string on a moon?
i want to pick up a string and remove the white spaces contained in it.nome = algumacoisa imagine that this is a string, I want to remove the blank spaces between the "name" and the "=" and the "="…
-
-1
votes1
answer370
viewsScript execution moon
People I want to run a script on the moon, but without having to write at the prompt every time lua (script).lua, just with his dll and executable inside the project, how could I? If they don’t…
luaasked 5 years, 4 months ago user151959 -
-1
votes1
answer62
views -
-2
votes2
answers716
viewsHow to check if a string contains a word
I wanted to know how to verify if a string exists a word, for example, I have two conditions for a situation the professional string can contain Medico or Paisanamedico. I wanted a north or way to…
-
-2
votes2
answers68
viewsComparison of numbers read with "io.read()" does not result in true as expected
I tried to put 1 and the second print was not. If I change x=io.read() for "x=1" it works normally Follows the code x = io.read() if x ~= 0 then print(x.." diferente de 0") end if x == 1 then…
-
-3
votes1
answer50
viewsHow to get index in an array list?
I need to check if there is an element with the nome as FH02, because I can’t use it because I don’t know where you stand. Config = {} Config.Homes = { {['nome'] = "FH02", ['qtde'] = 2, ['valor'] =…