Data Store only saving for one player

Hello Developer Forum, I have recently encountered a problem with my basketball game. The game has clothing that you can put on in-game. These clothes are suppose to save but, while I was testing it with my friend, it only seemed to work for him and not for me and the others. I am so confused on what to do since I’m still pretty new to DataStore. Thank you.

Also, heres the script:

1 Like

well, if you check something, the function PlayerAdded is essential to create individual values for each player,

with that said, your loop
[While true do]
is outside of it,

what this means?

it will loop, if you are alone in the server, it may work, but with + players, it will loop for everyone at the same time, for example:

local playernew

this variable is outside of player added function,
this means, this counts as a ‘‘global value’’,

if any player triggers something, and this variable is not individual, then, this will trigger to everyone ( also the script will memorize it, until someone change it back)

what i say is, put the loop inside the player added character function, and playernew too, you will notice the difference

because for each player, the serve will give ‘’ individual while true do" loops, and this will not interfere with anyone else, i believe this works since i followed the logic itself

+example:

local PlayerDied = false -- global

game.Players.PlayerAdded:Connect(function(player) 

local FurnaceActivated = false -- Individual

     
end)



I will try this and let you know how it goes. Thanks!