game.Players.PlayerAdded:Connect(function(plr)
local Ok, Result = pcall(function()
return DSS:GetAsync(tostring(plr.UserId.."-BAN"))
end)
if (Ok) then
-- // If the call was successful
if (Result) then
plr:Kick("GAMEBAN | Je bent Permanent Verbannen van deze server, dit betekend dat je geen toegang meer hebt tot de game, klopt dit niet maak een ticket in de Community Server.")
-- If the player has any data, kick them
else
-- // Player does not have any data
end
else
-- // Unable to get the player's data
end
end)
game.ReplicatedStorage["Admin System"].Pban.OnServerEvent:Connect(function(Player, plrToBan, Reason)
if Player:GetRankInGroup(MyModule.GroupID) >= MyModule.BanID then
local Table = {Reason}
DSS:SetAsync(tostring(game.Players[plrToBan].UserId).."-BAN", Table)
game:GetService("Players"):FindFirstChild(plrToBan):Kick("PERMBAN | ".. (Reason or ""))
Player.PlayerGui["Admin Panel"]:Destroy()
end
end)
Yup, no errors but the check doesn’t work, banning works and saving in database only the check doesnt work when a player joins. Here proof of database.
I am unable to assist you further as I see no issues with the scripts.
However, you can try printing Result to make sure the player has any data saved.
Please make sure that you test this in a live server.