I’ve been trying for a while with many different methods for saving characters after resetting and I’m pretty close with this, but I have an issue. It works perfectly fine with 1 player, but it doesn’t work for any players besides the first one.
Whenever a player chooses cosmetics, it’s added to a server script’s dictionary through a remote event, the player’s name is stored and an array is added to the dictionary entry that has the player’s cosmetics.
Well I don’t think that’d work because CharacterAdded checks for a specific player, I need to check every player in order to know which one is adding a character.
Your loop only loop one time through all players tho but what if another player loaded and the loop doesn’t happen it won’t add the hair to that player. By doing that whenever a character loaded the loop will run again through all players again. Or i am miss understanding something
Isn’t the player name already a string? Also, perhaps Player 2 hasn’t loaded in yet. Instead of looping through it once, try to use Players.PlayerAdded. If that doesn’t work or I’m misunderstanding what the script does at what time, you can wait for the character to fully load or use task.wait()
EDIT: Also, I noticed that you have a variable called “players” yet it is never used and you just use game.Players. Using game:GetService(“Players”) will probably do you better.