Jump to content
  • 0

can not find cause of error


animehack

Question

so i recently made some changes to my code but its now spitting an error that there is an unexpected symbol but idk what its talking about tbh

 

here is my error:

Script ended:
Script error: luaj.o: load /storage/emulated/0/Download/hax/gg/name/yessir.lua: luaj.o: /storage/emulated/0/Download/hax/gg/name/yessir.lua:1834
elseif then
unexpected symbol near 'then'
at luaj.LuaValue.a(src:997)
at luaj.Globals.c_(src:255)
at android.ext.Script.d(src:5992)
at android.ext.Script$ScriptThread.run(src:5785)
Caused by: luaj.o: /storage/emulated/0/Download/hax/gg/name/yessir.lua:1834
elseif then
unexpected symbol near 'then'
at luaj.a.h.a(src:295)
at luaj.a.h.c(src:299)
at luaj.a.h.h(src:1537)
at luaj.a.h.i(src:1548)
at luaj.a.h.j(src:1628)
at luaj.a.h.b(src:1741)
at luaj.a.h.k(src:1759)
at luaj.a.h.a(src:2074)
at luaj.a.h.M(src:2104)
at luaj.a.h.z(src:2224)
at luaj.a.h.A(src:2290)
at luaj.a.h.r(src:1789)
at luaj.a.h.J(src:1932)
at luaj.a.h.z(src:2228)
at luaj.a.h.A(src:2290)
at luaj.a.h.a(src:2306)
at luaj.a.u.a(src:121)
at luaj.a.t.a(src:99)
at luaj.Globals.a(src:364)
at luaj.Globals.a(src:352)
at luaj.Globals.a(src:267)
at luaj.Globals.c_(src:249)
... 2 more


and here is the code producing the issue:

while true do
if Qjctx == 2 then
    if gg.isVisible(true) then
        Qjctx = 2
        gg.setVisible(false)
    end
elseif then
    if Qjctx == 1 then
       if loader123 then
loader123()
   end
elseif then
    if exit then
          exit()
     end
end
end

Qjctx is = 1 and i want it to load the loader123() function that would then set Qjctx = to 2 and there for it should always defualt to main() function cuse i have this function:

while true do
    if gg.isClickedUiButton() and Qjctx == 2 then
           if main then
	          main()
	      end
    end
    gg.sleep(100)
end

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

8 minutes ago, animehack said:

/storage/emulated/0/Download/hax/gg/name/yessir.lua:1834

elseif then

unexpected symbol near 'then'

Just read whats error. 

Error occurs in line 1834.

You defined an elseif without condition.

Try use 'else' instead of 'elseif then'. 

Example:

a=1

if a==0 then print('lol')

else print('Now correct') end

Link to comment
Share on other sites

There is no condition specified after elseif

while true do
	if Qjctx == 2 then
		if gg.isVisible(true) then
			Qjctx = 2
			gg.setVisible(false)
		end
	elseif Qjctx == 1 then
		-- if Qjctx == 1 then | Moved this up, and you forgotten an 'end'
		if loader123 then
			loader123()
		end
	elseif exit then -- And only exit won't problably work if it isnt a variable... Cuz you're asking if 'exit == true'
		-- if exit then | Moved up too
		exit()
		-- end | Removed cuz i took 'if exit' out
	end
end

 

Link to comment
Share on other sites

14 hours ago, RCPOLSKI said:

There is no condition specified after elseif


while true do
	if Qjctx == 2 then
		if gg.isVisible(true) then
			Qjctx = 2
			gg.setVisible(false)
		end
	elseif Qjctx == 1 then
		-- if Qjctx == 1 then | Moved this up, and you forgotten an 'end'
		if loader123 then
			loader123()
		end
	elseif exit then -- And only exit won't problably work if it isnt a variable... Cuz you're asking if 'exit == true'
		-- if exit then | Moved up too
		exit()
		-- end | Removed cuz i took 'if exit' out
	end
end

 

while this solved my error i hade some other problems and i hade mod your code a bit but thx for helping me move forward and yes i have a exit() function

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.