I need help with Ban System

Hello! I made a Ban System and this should show to the player in Banned list a GUI, but this don’t show to me a GUI :sob:

local Banned = {
	["MrRBX_Dev"] = "You are banned!\nReason:\nTests is cool"
}
game.Players.PlayerAdded:Connect(function(player)
	if player.Name == Banned[player.Name] then
		local GuiFolder = player.PlayerGui
		GuiFolder.Notificationv2.Frame.Visible = true
		GuiFolder.Notificationv2.Frame.Frame.Text.Text = Banned[player.Name]
		warn("Showed for player".. player.Name .. " Ban screen")
	else
		print(player.Name .." is very good player! pog")
		local GuiFolder = player.PlayerGui
		GuiFolder.DaMene.Enabled = true
	end
end)

Can someone help me with this script above?
Thanks for all replies

This would check if the palyer’s name is equal to the reason. Just do

if Banned[player.Name] then

Also I’d recommend checking UserIds instead of names as they can evade the ban by changing their username

1 Like