I'm trying to save the TeamColor of a Player when he leaves the game, but the Script isn't working, and I don't know the reason.
Script:
local DataService = game:GetService("DataStoreService") local TeamData = DataService:GetDataStore("TeamStore") game.Players.PlayerAdded:Connect(function(Plr) local t = TeamData:GetAsync(Plr.UserId) Plr.TeamColor = BrickColor.new(t) end) game.Players.PlayerRemoving:Connect(function(Plr) local TeamColor = tostring(Plr.TeamColor) TeamData:SetAsync(Plr.UserId, TeamColor) end)