So I have a gui with a local script for the ban:
local frame = script.Parent.Frame
local button = script.Parent
button.MouseButton1Click:Connect(function()
if frame.Visible == true then
frame.Visible = false
else
frame.Visible = true
end
end)
frame.Cancel.MouseButton1Click:connect(function()
frame.Visible = false
end)
local playerName = frame.Player.Text
local reasoning = frame.Reason.Text
frame.Ban.MouseButton1Click:connect(function()
if game.Players:FindFirstChild(frame.Player.Text) then
game.ReplicatedStorage:WaitForChild("Ban"):FireServer(playerName, reasoning)
end
end)
frame.Unban.MouseButton1Click:connect(function()
if game.Players:FindFirstChild(frame.Player.Text) then
game.ReplicatedStorage:WaitForChild("Unban"):FireServer(playerName)
end
end)
And in SSS, I have a script:
local datastore = game:GetService("DataStoreService"):GetDataStore("BansAndUnbans")
game.Players.PlayerAdded:connect(function(player)
local data = datastore:GetAsync(player.UserId)
if data then
if data[1] == true then
player:Kick("You have been banned. Reason: "..data[2])
end
end
end)
game.ReplicatedStorage:WaitForChild("Ban").OnServerEvent:connect(function(player, playerName, reasoning)
if game.Players:FindFirstChild(playerName) then
game.Players(playerName):Kick("You have been banned. Reason: "..reasoning)
datastore:SetAsync(game.Players(playerName).UserId, {true, reasoning})
end
end)
game.ReplicatedStorage:WaitForChild("Unban").OnServerEvent:connect(function(player, playerName)
local players = game:GetService("Players")
local id = players.GetUserIdFromNameAsync(playerName)
datastore:RemoveAsync(id)
end)
When I test it out, nothing happens. Player doesn't get kicked, nothing in the output.

2 comments
there SHOULD be something in the output. line 15 you have a syntax error. when using a variable inside an object value, you denote the beginning of the variable name with brackets ( [] ), not parentheses. the interpreter thinks that you're trying to call an instance value when you do this. Same for line 16
game.Players[playerName]:Kick("etc")