local M=require((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).RankCache);(game:GetService("\080\108\097\121\101\114\115")).PlayerAdded:Connect(function(g)M:FetchPlayerInfo(g)end);(game:GetService("\080\108\097\121\101\114\115")).PlayerRemoving:Connect(function(g)M:ClearPlayerInfo(g)end)
--[[
    This script uses the RankCache library to fetch a user's group data when they join
    and clear it again when they leave.

    You may want to use this script if your game relies heavily on ranks which change during server runtime.
]]

local rankCache = require(game:GetService('ReplicatedStorage').RankCache)

--// Fetches a user's information for the default configured group
game:GetService('Players').PlayerAdded:Connect(function(player)
    rankCache:FetchPlayerInfo(player)
end)

--// Clears the user's information after they leave the game
game:GetService('Players').PlayerRemoving:Connect(function(player)
    rankCache:ClearPlayerInfo(player)
end)