• Custom teams error
    1 replies, posted
Sup community, if been working on a command so that people can create their own team in game, although i can't get it quite right. currently struggling on this error (btw im a noob ) anyone knows how to fix it [ERROR] gamemodes/basewars/gamemode/init.lua:230: attempt to perform arithmetic on local 'number' (a table value)   1. unknown - gamemodes/basewars/gamemode/init.lua:230    2. unknown - lua/includes/modules/concommand.lua:54 function CreateNewTeam(ply) print("test"); local number = team.GetAllTeams() local teamname = (ply:GetNWInt("Teamname")) team.SetUp(number + 1,teamname,Color(255,255,255,255)) << 230 line end
team.GetAllTeams() returns a table, not a number. You're trying to add 1 to a table of teams. Use #team.GetAllTeams() to get the size of the table.
Sorry, you need to Log In to post a reply to this thread.