Jump to content
  • 0

Check if function have been executed to unlock full function menu


MrMikeMichael

Question

Posted

Hey,

In my mod menu I have a function that only will find and save values.

Under that I have 3 other functions that only will work if the first hack had been activated.

So I wonder if there's a way to make those 3 functions only appear in my submenu if the first function has been executed once.

Theory crafting.txt

 

6 answers to this question

Recommended Posts

Posted

Use variables, and do alter menu when your script sets  true after searching your value.

Or check your value availability and if not, call function search.

Posted
27 minutes ago, Rs92ks said:

Use variables, and do alter menu when your script sets  true after searching your value.

Or check your value availability and if not, call function search.

Have you got a template of what this might look like? 

Posted

Template (not really executable)

--script start line
local gg=gg
local search=false

function menu()
If search==true then
m=GG .menu(extended)
Else m=GGmenu(short) end
Function search ()

--code

search==true

 

Posted
10 hours ago, MrMikeMichael said:

Hey,

In my mod menu I have a function that only will find and save values.

Under that I have 3 other functions that only will work if the first hack had been activated.

So I wonder if there's a way to make those 3 functions only appear in my submenu if the first function has been executed once.

Theory crafting.txt 2.99 kB · 3 downloads

 

I think this should work

hasRun = false

function SSM()
	local menu_items 
	local menu_functions
	if hasRun == false then
		menu_items = {"Find Sprint Speed Value!", "Instructions", "Back", "Home"}
		menu_functions = {"FFS", "SSI", "Back", "start"}
	else
		menu_items = {"Find Sprint Speed Value!","Sprint Speed Normal", "Sprint Speed x 2.5", "Sprint Speed x 5","Instructions", "Back", "Home"}
		menu_functions = {"FFS", "SSN", "S25", "S5", "SSI", "Back", "start"}	
	end
    gg.setVisible(false)
	local Menu = gg.choice(menu_items, nil, "SPRINT SPEED MENU")
 	if Menu ~= nil then 
		_G[menu_functions[Menu]]
 	end 
end

function FSS()
	hasRun == true
	gg.setRanges(gg.REGION_C_ALLOC)
	gg.searchNumber("1,999,410,999D;1F;688892D;16D;35165D::49", gg.TYPE_FLOAT)
	gg.refineNumber('1', gg.TYPE_FLOAT)
	local sprSpe = gg.getResults(gg.getResultsCount())
	gg.saveVariable(sprSpe, gg.EXT_CACHE_DIR.."/SS")
	gg.clearResults()
	gg.toast("Sprint Speed Found!")
	SSM()
end 

 

Posted

Coop menu method,

but HasRun == true is not defines value.

Location

2 hours ago, BadCase said:

 

function FSS()
	hasRun == true
	

 

I have same mistake 🤣

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.