Skip to main content
0 votes
0 answers
148 views

I am making a card game and im now revamping how individual card information is stored. a single card would have the following values: x, y, suit, number, state this is to be stored in a deck array ...
Mounif Alzougbi's user avatar
1 vote
1 answer
100 views

So I have the following table: local table_arr = { a = 3, b = 42, c = 10 } And my for loop: for x=1, #table_arr do local key, value = table_arr[x], arr[ table_arr[x] ] print(key) -...
C0nw0nk's user avatar
  • 992
2 votes
3 answers
107 views

As I understand Lua, an array is just a table where the keys start at 1 and increment sequentially. However, there are features within Lua to manipulate arrays in the traditional sense (e.g. ipairs, ...
deltamind106's user avatar
1 vote
1 answer
64 views

I have a code: function subsets(t) local res={} local res_t={} function subs(i) if i>#t then res[#res+1]=res_t return end res_t[#res_t+1]...
Saf Whale's user avatar
0 votes
2 answers
93 views

I'm trying to make a dance floor that lights up and changes colors periodically. So far I've gotten the game to load and pick a random color from the array upon loading, but I can't make the tiles ...
Shinikage's user avatar
0 votes
0 answers
98 views

Lua table (ref) index changes its values without assigning any to them. Why does ref table change its values after assigning it to tab[c] or using string.match()? The actual behavior is that the ref ...
Jepamb's user avatar
  • 1
-1 votes
1 answer
80 views

I program in Lua and I need some help: I have file1.lua and file2.lua In file1.lua: loadstring('print("Hello World!")') in file2.lua: _loadstring = loadstring function loadstring(code) ...
kaleb sociais's user avatar
1 vote
0 answers
32 views

I have this function that takes a string (s) and returns a table depending on what I entered. function String2Faction(s) if s == "Nomads" then return Faction_Nomads elseif s =...
Xano's user avatar
  • 11
3 votes
1 answer
80 views

I started learning Lua recently, as far as I can tell, when I don't specify the index, the function table.insert tries to put the value in the first nil in the table. Why then is it that in table t ...
Rafael's user avatar
  • 31
0 votes
1 answer
483 views

I'm trying to make my first Roblox studio game and I ran into this problem: attempt to call missing method 'UpdateCharacter' of table attempt to call missing method 'Equip' of table Any function ...
Oscar Charlo's user avatar
1 vote
1 answer
102 views

In lua, if we try to index a series of nested table (any of which can be nil), we might write code like this: -- try to get a.b.c local ret if a then local b = a.b if b then ret = b.c ...
lhh2001's user avatar
  • 31
1 vote
1 answer
56 views

Like I got two tables: {["a"] = "aaa"} and {["b"] = "bbb"} And make it into one table: {["a"] = "aaa", ["b"] = "bbb"} I ...
Sapbot SCS's user avatar
2 votes
1 answer
30 views

Here's code for a timer: local copyTable = require("Helpers.copyTable") local timer = {} timer.max = 0 timer.time = 0 function timer:add(dt) timer.time = timer.time + dt end function ...
Jackson Kidwell's user avatar
3 votes
2 answers
151 views

Why does the table.unpack() function print the unpacked table only if there is nothing following the function? > print(table.unpack({1,2,3})) 1 2 3 > print(table.unpack({1,2,3}),&...
4a6166's user avatar
  • 33
1 vote
1 answer
81 views

So I'm trying to make a table of all the creatures in a game, each creature consisting of a table with their stats. I used the creature's name as the key in the first table, but now I need to get that ...
Gabriel's user avatar
  • 25

15 30 50 per page
1
2 3 4 5
97