Hi people! This is my first post on facepunch. I decided to make an account and make a post about my problem.
I’m recently started making gmod addons (simple and test ones).
Today I’m making the most complicated and complexed addon I ever made
But I have found a problem that i cant solve.
[ERROR] addons/rpcharacter/lua/rpcharacter/server/sv_functions.lua:7: bad key to string index (number expected, got string) 1. error - [C]:-1 2. __index - lua/includes/extensions/string.lua:310 3. hasCharacter - addons/rpcharacter/lua/rpcharacter/server/sv_functions.lua:7 4. unknown - addons/rpcharacter/lua/rpcharacter/server/sv_commands.lua:2 5. unknown - lua/includes/modules/concommand.lua:54
local meta = FindMetaTable( "Player" ) function meta:getCharacterFile() return "rpcharacter/characters/" .. self:UniqueID() .. ".txt" end function meta:hasCharacter() local file = self:getCharacterFile() return file.Exists( "data", "GAME" ) -- Line 7. ERROR IS HERE end
concommand.Add("chdebug", function(ply) print(ply:hasCharacter()) end)
Also i tried to google it but I found nothing that could fix it.
May someone help me and explain why this is not working?
EDIT: added error line