I have a game that I just set up to store teams, but the teams will not save for some reason. My script is not outputting anything. Here's the code:
local DataStoreService = game:GetService("DataStoreService")
local TeamStored = DataStoreService:GetDataStore("TeamStored")
game.Players.PlayerAdded:Connect(function(player)
success, err = pcall(function()
local team = TeamStored:GetAsync(player.UserId, BrickColor.new(player.TeamColor)) -- Get
if success then
player.TeamColor = team
else
print("There was an error getting " .. player.Name .. "'s data")
warn(err)
end
end)
game.Players.PlayerRemoving:Connect(function(player)
local success2, err2 = pcall(function()
TeamStored:SetAsync(player.UserId, BrickColor.new(player.TeamColor)) -- Save
end)
if success2 then
print("Player data successfully saved for " .. player.Name)
else
print("Player data NOT successfully saved for " .. player.Name)
warn(err2)
end
end)
end)
Please help!

2 comments
Are you sure that there are no outputs from the print()s?
Yes, there was absolutely nothing in the developer console.