Hi, I've been trying to make a logging system for exploiters, but I'm getting this error:
ServerScriptService.Log:6: table index is nil
This is (part) of my script:
local cache = {}
local flagged = {}
function log(plr,log)
if not cache[plr.Name] then
cache[plr.Name] = true
game.HttpService:PostAsync(hook,game.HttpService:JSONEncode({["content"] = log}))
if not flagged[plr.Name] then
flagged[plr.Name] = 0
end
flagged[plr.Name] = flagged[plr.Name] + 1
if flagged[plr.Name] == 3 then
plr:Kick("Flagged\n\nReport To Devs With Code 35")
end
delay(4,function()
cache[plr.Name] = false
end)
end
end

8 comments
what line is the error on?
Line 6\
Is line 6 on the entire script, line 6 on the snippet of the script you sent? I don't see anything wrong with line 6 here
same. That's why I posted it on this site. The error is on line 6. You can tell by the ":6:" in the error code
wait... im dumb
Yeah, I know that. I just wanted to make sure because you said this is part of the script, so line 6 in the snippet you sent could be line 23 for example in the entire script. Anyway can you add the snippet of when the log function is ran? This error means plr.Name is nil
Lol I didn't mean to say I know you're dumb that was terrible timing lmao
it's fine. I made sure to make the error message on the right thing