So, I am trying to use ProfileService to ban users and save player data. Although it doesn’t seem to kick the user even when the data in the Dev Console shows the ban being set to “true.”
local ProfileCache = require(game.ServerScriptService.Modules.ProfileCacher)
local function CheckBanned(player)
local playerProfile = ProfileCache[player]
if playerProfile~= nil then
if playerProfile.Data.Banned == true then
player:Kick("Youve been banned")
print("[ProfileService]: " .. player.Name .. " has been kicked due to being banned")
end
end
end
game.Players.PlayerAdded:Connect(CheckBanned)