Jump to content
  • 0

Lua Menu Question


Maddin

Question

Hello,

I would like to make a menu including submenus.

I know the function
Function Main()
If menu == 1 then Submenu()

and so on...

But what I want to do is for example

I have a table with all characters incl. their values I need
local characters = {
    {sname = "bunny", name = "bunny rabbit", size = 4, size2 = 8, size3 = 9},
    {sname = "mouse", name = "Micky Mouse", size = 1, size2 = 12, size3 = 22},
    {sname = "cow", name = "the cow", size = 30, size2 = 33, size3 = 423},
    {sname = "boy", name = "a friend", size = 44, size2 = 55, size3 = 666}
}

as main menu - "character selection"
   -> below it the submenu - "Initial letter A
   -> below that the submenu - "Initial letter B"
        -> -> below that all characters starting with the letter B should appear and be selectable. So "bunny" and "boy


But I don't want to program every single submenu with function bunny() or function boy().

Is there a way to automatically create the submenus based on the table and make them selectable. The value should then simply be written to a variable provided for this purpose.

The problem is that the table is constantly growing, so I would have to add each time a submenu by hand.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

21 hours ago, Maddin said:

as main menu - "character selection"
   -> below it the submenu - "Initial letter A
   -> below that the submenu - "Initial letter B"
        -> -> below that all characters starting with the letter B should appear and be selectable. So "bunny" and "boy

I want to help you but i dont really understant this part can you explain more ?

Link to comment
Share on other sites

Sorry a lot, my English is not the best.

OK, so what I mean by that is.

In a table I have all my characters with the values I want to change with Gameguardian. This table is constantly expanding with new characters.

Now it would be so that I have in the main menu e.g. the alphabet (this makes sense with 300 and more characters). If I click there e.g. on the letter B, then as a submenu all characters are to be shown which begin with the letter B.

As an example:
Main menu = A, B, C, ..., X, Y, Z
if I now click on B, then all characters from the local character ={} should appear that start with B, in this simple example that would be "bunny" and "boy".
If I click now e.g. "bunny", then e.g. a function - function incrementsize() should be activated. But before that the value "size" which is also stored in the table must be stored in a variable, or can this value be passed directly into this function by calling the function e.g. function incrementsize(size=4).

It is important, if a new character with B comes into play - e.g. "bobbybrown" that this appears automatically in the submenu to the main menu - B and not a function function bobbybrown() must be written.

I hope I could explain this with my English now so far, so that it is understandable what I mean. If not, then please ask again.

Link to comment
Share on other sites

Sorry for late i understand more and i think i have better idea for you my concept is to create a table for each character this table will contain all needed data for this character and perform the hack, i think this will be more easy to add new characters in the futures it doesn't require a lot of edit

Link to comment
Share on other sites

Sorry for late i understand more and i think i have better idea for you my concept is to create a table for each character this table will contain all needed data for this character and perform the hack, i think this will be more easy to add new characters in the futures it doesn't require a lot of edit

[added 1 minute later]

I tried to make this tell me if it match to your concept 

template.lua

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.