Anonyme Ban not working

Hello developers,
for unknown reasons even when I am in the anonyme banned table the gui wont clone and change the texts. Script:

Code blocks:

game.Players.PlayerAdded:Connect(function(player)
if FBan.AnonymeBanned[player.Name] == true then
local weirdEffect = game:GetService("ReplicatedStorage").AnonymeBan
local putWeirdEffect = weirdEffect:Clone()
putWeirdEffect.Parent = player.PlayerGui
wait(5)
player.PlayerGui.AnonymeBan.Frame.TextLabel.Text = "ERROR. CLIENT LOSTED!"
wait(5)
player.PlayerGui.AnonymeBan.Frame.BackgroundColor3 = Color3.new(0, 0, 0)
player.PlayerGui.AnonymeBan.Frame.Transparency = 0
wait(10)
player:Kick("System error has occured.")
    end
end)

How is the table set up? Is it an array or a dictionary?

It is a dictionary currently. And I prefer dictionary.

Ok, add this before the if condition:

print(FBan.AnonymeBanned)

If it prints your name, are there any errors?

It’s did not print it. That is so weird.

Is this a server script or a local script?

A error in the console.
Table index is nil.

The function it’s error at is:

Here it is in lua blocks since it’s got removed.

function FBan.AddAnonymeBan(player)
FBan.AnonymeBanned[player.Name] = true
end

Ok, can I see how your entire table is set up?

This is a nitpick, but you should use a : and self, if you’re gonna call a function that interacts with itself

Can you show me a fix of the function?

function FBan:AddAnonymeBan(player)
   self.AnonymeBanned[player.Name] = true
end

FBan:AddAnonymeBan(Player) -- call it like this

It’s just syntax sugar.

Uhm. FBan is my module. So do I still put

self?

No.

Anyway, what does the table structure look like?

Also. I wanna it be able to work in others scripts.

It’s look like this:

FBan.AnonymeBanned = {}

Ok, and the error was something like attempt to index nil with "..." ?

The error was table index is nil.

I’ve never seen that error before. But judging by the text shown, it’s probably saying that either FBan.AnonymeBanned is nil or FBan.AnonymeBanned[player.Name] is nil.

How would this be set to nil? I putted it to true: