Jump to content
  • 0

help me how to fix my script


HEXCODEHK

Question

Script ended: Script error: luaj.o: load /storage/emulated/0/Documents/PG3D_lua_script_copy.lua: luaj.o: /storage/emulated/0/Documents/PG3D_lua_scriptcopy.lua:332 end ''end'' expected (to close ''if'' at line 32) near <eof> 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/Documents/PG3D_lua_scriptcopy.lua:332 end ''end'' expected (to close ''if'' at line 32) near <eof> at luaj.a.h.a(src:295) at luaj.a.h.c(src:299) at luaj.a.h.b(src:1021) at luaj.a.h.M(src:2107) 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.M(src:2106) 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.M(src:2106) 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.M(src:2106) at luaj.a.h.z(src:2224) at luaj.a.h.A(src:2290) at luaj.a.h.a(src:1449) at luaj.a.h.N(src:2163) at luaj.a.h.z(src:2246) 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

PG3D lua script (copy).lua

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Hi! Your script has a lot of errors; Mainly caused by (Else, If, End) in the wrong position. While coding, You should take a look on:

Quote

Formatting

Indentation - Indenting often uses two spaces. This is followed in Programming in Lua, the Lua Reference Manual, Beginning Lua Programming, and the Lua users wiki. (Why this is the case, I don't know, but perhaps it is because Lua statements can tend to be deeply nested, even in a LISP or functional manner, or perhaps it is affected by the fact that the code in these examples is small and pedagogical.) You'll see other common conventions (e.g. 3-4 spaces or tabs).

# Example
for i,v in ipairs(t) do
   if type(v) == "string" then
      print(v)
   end
end

I have restructured your whole script, you can compare the changes here: PG3D-Lua
In the future, You can always check for errors in your script here: Lua Online Compiler

1940782662_PG3Dluascript(copy).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.