#Clan leave system not working as expected

1 messages · Page 1 of 1 (latest)

sharp citrus
#

basically if u try to leave the clan although i removed async and removed the player from the server cache it still says the old clan name in the debug message and that the player has left just now (although when u leave again the same exact thing would pop up) and as u can also see when i join back im still in the same clan.(video attatched if u can tell whats going on ;))
whole module script and server script attatched

main module script clan removing logic:```lua
function clan:removeID(player: Player)
local succ, err = pcall(function()
playerClanData:RemoveAsync(tostring(player.UserId))
end)
if succ then
print("Removed clan ID for player:", player.Name)
else
warn("Failed to remove clan ID for player:", player.Name, err)
end
end

function clan:remove(player: Player)
self.members[player.UserId] = nil
self:removeID(player)
self:SaveToDs()
end

```lua
main clan removing server script logic:
leaveClan.OnServerEvent:Connect(function(player)
    local clan=playerClans[player.UserId]
    if clan then
        clan:remove(player)
        print(player.Name , "left", clan.name)
    else
        warn(player.Name , "is not in this clan")
    end
end)
#

oh i didnt know it formatted like that lemme just rmeove the .txt then

#

good luck understanding whatever this absurd thing is😔