Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to store int values in a folder for each player, that won't reset when they die? (Answered)

So, I tried making a folder and putting lots of int values in it. I've tried changing them and some other stuff, but whenever I reset it resets them back to normal. Is there a way to keep the values the same, even if they die? I need different values for each player, not just one shared for all players. Wait, could I just put them in a gui, or would they reset when the player dies? I dont want datastore.

1 answer

✓ Accepted answer
--[[Put that script on ServerScriptService, get your folder with the IntValues and Rename it to
 "Data" and put it inside the script]]--

Players = game:GetService("Players") --Get players service.
 
Players.PlayerAdded:Connect(function(player) --Do a function when a player is added.
	local Data = script:WaitForChild("Data"):Clone()  --Will make a copy of the data folder
        if player then  --It will check if the player exists.
        Data.Parent = player --It will insert the folder inside the player
        end
end)

It will Clone your Data folder to the player that can be found inside game.Players[PlayerName]. as i remember it should not reset the values when player respawn.

Used: PlayerAdded

2 comments

0

Oh, great idea.

0

It seems to work, thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.