Hello,
For some time now, I've been having some issues with team.GetName()
Whenever I call it I get the following error:
[ERROR] addons/sgc_scoreboardsql/lua/autorun/server/sv_sgcsb.lua:752: attempt to index a string value with bad key ('GetName' is not part of the string library)
1. error - [C]:-1
2. __index - lua/includes/extensions/string.lua:297
3. v - addons/sgc_scoreboardsql/lua/autorun/server/sv_sgcsb.lua:752
4. unknown - lua/includes/modules/hook.lua:84
Affected line of code:
print("Team name 4: ".. team.GetName( 4 ) )
The thing is, I can for example do this:
print("Team: "..ply:Team())
Which prints on console:
Team: 4
I have tried with ply:Team() and other stuff and still errors.
Funny enough, last night I edited the file and made it with the right functions (this is a chat logging system)
local logReason = ("<" ..ply:Nick().. "> <" ..team.GetName(ply:Team()).. ">: " ..message.. "")
And that worked for a night until it started error-ing again...
Any help would be appreciated,
Thanks
Your team variable is not the team library, it a string variable defined somewhere above the problematic line. Do not make variables with library names.
You're probably making your own 'team' variable somewhere before you call team.GetName.
It was that, thank you, It wasn't on that file specifically or in any of that addon, it was somewhere else.
Sorry, you need to Log In to post a reply to this thread.