sqlluaazerothcoreeluna-lua-engine

Field 'team' doesn't have a default value / Unhandled MySQL errno 1364. Unexpected behaviour possible


I found this script online and i'm new to lua but i want to learn lua. I have coding knowledge but not in lua. I have tried to contact to owner of the script but i think he's busy in real to make it work for my latest trinitycore.

I will link the sql imported for commands aswell.

this is the lua error & sql:

lua_scripts/Grumbo'z Guild Warz.lua:2083: attempt to index field '?' (a nil value) [1364] Field 'team' doesn't have a default value Unhandled MySQL errno 1364. Unexpected behaviour possible. commands for: RA : created. lua_scripts/Grumbo'z Guild Warz.lua:508: attempt to index field '?' (a nil value)

Another error :

[Eluna]: Error loading lua_scripts/Grumbo'z Guild Warz.lua lua_scripts/Grumbo'z Guild Warz.lua:732: expected near '=='

I've trying fixing it myself but none of my ideas were working. Couldn't find anyone with the same kinda problems as mine.

Lua script is to long to post here so i'm trying to link it via pastebin:

https://pastebin.com/viVcmbz6

Sql command script is to long to post here so i'm trying to link it via pastebin:

https://pastebin.com/uA5SNFxp

Expected result : This script should enable war between guilds & building guild buildings.


Solution

  • lua_scripts/Grumbo'z Guild Warz.lua:508: attempt to index field '?' (a nil value)

    got to line 508:

    GWCOMM[PLAYER_GUILD_ID].commands
    

    GWOCOMM[PLAYER_GUILD_ID] is nil. Find out why.

    lua_scripts/Grumbo'z Guild Warz.lua:732: expected near '=='

    go to line 732

    if(GWARZ[LocId].  ==0)
    

    There is nothing behind the index operator! This error can only be fixed if you understand what the program is supposed to do here.