Problem with a table

Hi, I have this table in a ModuleScript:

local FunctionTable = {
SPermBanTable = {
[2319923406] = {“Bye Megami”}
}
}

And I wanna kick those in it, but with the following code, I get an attempt to concatenate string with table on the Player:Kick, any idea why? (Note there will be values inserted to it from that modulescript and the one there is just for testing)

local function CheckServerBan(Player)
	local ServerBanModule = require(Modules.Moderation.ServerBanModule)
	local SPermBanTable = ServerBanModule["SPermBanTable"]
	local specificID = Player.UserId
	for id, reason in pairs(SPermBanTable) do
		if id == specificID then
			Player:Kick("You are permanently banned from this server. The reason is: "..reason)
		end
	end
end

SPermBanTable contains tables and not strings, you probably required it wrong. If you want to convert the table into a string use table.concat()

1 Like
local function CheckServerBan(Player)
	local ServerBanModule = require(Modules.Moderation.ServerBanModule)
	local SPermBanTable = ServerBanModule.SPermBanTable
	local specificID = Player.UserId

	for id, reason in pairs(SPermBanTable) do
		if id == specificID then
			Player:Kick("You are permanently banned from this server. The reason is: "..table.concat(reason))
		end
	end
end

we can fix this by using table.concat()