BaldiGT Posted December 8, 2018 Share Posted December 8, 2018 Please Help me I want to chose 1 and 3, but it just Execute number 1...please help me how to fix it... testing.lua gg.clearResults() g = gg.multiChoice({'1','2','3'},nil,'Chose Your TYPE') if g[1] then gg.searchNumber('1',gg.TYPE_WORD) gg.getResults(9) gg.editAll('1',gg.TYPE_DWORD) end if g[2] then gg.searchNumber('2', gg.TYPE_WORD)gg.getResults(8)gg.editAll('488', gg.TYPE_WORD) end if g[3] then gg.searchNumber('3',gg.TYPE_FLOAT) end if g == nil then os.exit() end Link to comment Share on other sites More sharing options...
maulz Posted December 8, 2018 Share Posted December 8, 2018 "g[1] == true" testing.lua Link to comment Share on other sites More sharing options...
BaldiGT Posted December 8, 2018 Author Share Posted December 8, 2018 20 minutes ago, maulz said: "g[1] == true" testing.lua Its not work.....if i chose number 1 and 3 it just execute 1 code.... Link to comment Share on other sites More sharing options...
Administrators Enyby Posted December 8, 2018 Administrators Share Posted December 8, 2018 Wrong nil check order - this check should be first. Incorrect access to indices is either strings or numbers. There are no cleaning results for each option, which causes searches to become dependent. Instead of looking for something, try to make prints in each block, see which blocks are executed and where. Link to comment Share on other sites More sharing options...
maulz Posted December 8, 2018 Share Posted December 8, 2018 2 hours ago, BaldiGT said: Its not work.....if i chose number 1 and 3 it just execute 1 code.... that's work for me Link to comment Share on other sites More sharing options...
Question
BaldiGT
Please Help me
I want to chose 1 and 3, but it just Execute number 1...please help me how to fix it...
testing.lua
gg.clearResults()
g = gg.multiChoice({'1','2','3'},nil,'Chose Your TYPE')
if g[1] then gg.searchNumber('1',gg.TYPE_WORD) gg.getResults(9)
gg.editAll('1',gg.TYPE_DWORD)
end
if g[2] then gg.searchNumber('2',
gg.TYPE_WORD)
gg.getResults(8)
gg.editAll('488', gg.TYPE_WORD)
end
if g[3] then gg.searchNumber('3',gg.TYPE_FLOAT)
end
if g == nil then os.exit() end
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.