Hello. Today, while writing a script, I encountered an error. The whole point is that I wanted to make a menu with functions for a separate game, and gave this error:
Quote
Script complete:
Script error: luaj.o: /storage/emulated/0/DCIM/SharedFolder/Tutorial.lua:16
`if games == 1 then somenu() end`
attempt to call a nil value (global 'somenu')
level = 1, const = 16, proto = 1, upval = 1, vars = 4, code = 54
CALL v0..v0
; PC 45 CODE 0080401D OP 29 A 0 B 1 C 1 Bx 513 sBx -130558
stack traceback:
/storage/emulated/0/DCIM/SharedFolder/Tutorial.lua:16 in main chunk
[Java]: in ?
at luaj.LuaValue.a(001B.java:2)
at luaj.LuaValue.Z(001B.java)
at luaj.LuaValue.l(001B.java)
at luaj.LuaClosure.a(0105.java)
at luaj.LuaClosure.l(0105.java)
at android.ext.Script.d(004E.java:22)
at android.ext.Script$ScriptThread.run(0022.java)
I hope you can help me and give me the corrected script. It's just that I'm just starting to remember how to write scripts, and I don't remember anything I did a year ago.
Full script below
if gg.isVisible(true)then
gg.setVisible(false)end
goto menu
::menu::
menu = gg.choice({'Games','Exit'},nil,'MultiScript by CloniuStudio')if mine ==1then games()endif mine ==2then exit()end::games::
games = gg.choice({'Standoff 2','Back'},nil,'MultiScript by CloniuStudio')if games ==1then somenu()endif games ==2then menu()endfunction somenu()
somenu = gg.choice({'SkinChanger [🖌]','Back'},nil,'Standoff2 Menu')if somenu ==1then sochangermenu()endif somenu ==2then games()end::exit::
gg.toast('MultiScript by CloniuStudio')
os.exit()end
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.
Question
cloniu
Hello. Today, while writing a script, I encountered an error. The whole point is that I wanted to make a menu with functions for a separate game, and gave this error:
I hope you can help me and give me the corrected script. It's just that I'm just starting to remember how to write scripts, and I don't remember anything I did a year ago.
Full script below
Thanks!
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.