How to Make a CHARACTER SHOP but the skin saves when you die

So i was following a tutorial on this video [READ DESCRIPTION FOR NEW VERSION] How to Make a CHARACTER SHOP | HowToRoblox - YouTube
its a good video tutorial but there’s one problem, i wanted to make the character’s skin saved when you die

robloxapp-20210916-0738448.wmv (1.9 MB)

1 Like

Make a characteradded function and if they have that equipped then run the function to give it to them.

You will need to keep a value in the player to make sure they have that item and if they do.

where do i add the characterAdded function Thing?

When the player joins you add it underneath.

https://developer.roblox.com/en-us/api-reference/event/Player/CharacterAdded

i don’t really get it, do i have to put the code samples in the ServerScriptService or in the Workspace?

Hi! I’ll walk you through what I personally would do.

First, take advantage of ROBLOX’s free data storage, and use their Datastore Service.
After I set up a valid way for Datastore to work both upon joining & leaving, I would…
Set a dictionary up, add players to it and store all their data stored within it, then make external values to store those values in another table upon leaving, then store those in the new table. it would most likely look something like this:

local DatastoreService = game:GetService("DatastoreService");
local PlayerDatastore = DatastoreService:GetDatastore("Players");

local Players_Data = {}; --[[These would take indexes of players UserId, then would
have the actual data tied to them via a dictionary]]--
local Ingame_Data = {}; --[[This'll update every now and then,
make sure this updates every now and then, or upon them clicking save? idk, 
I'm actually trying to explore new options rn so let me know if this idea is bad.
]]--
game.Players.PlayerRemoving:Connect(function(Player)
    local Current_Data = GetCurrentData(Player.UserId); --[[ this is just a fetch function, pulling the index by their id and what not, not writing all of this, just for reference, but to give an idea, you'd be pulling from the Ingame_Data table since that'd be the values you're trying to replicate and save, and then vise versa for replicating back into the game.]]--
    local Data_Table = { Level = Current_Data.Level, Skin = Current_Data.Skin} -- And whichever values you really need... }
};

    local Success, Error = pcall(function()
        PlayerDatastore:SetAsync(Player.UserId, Data_Table)
    end)
end)

I think you get what I’m trying to do, this just serves as a small example, I’ll leave the rest to you, but this is primarily how I’d handle it. I hope I helped! :grinning_face_with_smiling_eyes:

where do i put the script
do i put it in serverscriptservice?

uuuuh…

It was more of an example of how to make something like this, not a hand-me-over copy of the code. You’re going to have to program it yourself, unfortunately. The devforum serves as a place to learn off each other, and just give copies of each others homework in an analogical sense, if you get what I mean. :confused:

oh well okay then thanks ill llook into this

Btw you miss spelled some parts of the script

I’m not sure I find this really useful, as I don’t care much for grammar, nor does it really matter when setting variables, so thanks I guess?

Misspelled is a word by itself. I don’t think it’s split into two… You’re welcome! :smiley:

I’m sorry to tell you this but uh i cant really seem to do it
i don’t really understand this Saving data Sorry

i tried so hard to understand it but nothing i couldn’t do it

Well, first you should undergo a proper way to learn how to program, whether you want to self teach yourself or not, it’s entirely up to you!

Find people that can teach, watch youtube videos, the devforum is always here to help, and most importantly, ROBLOX has their own place for learning how to program, it’s their API reference, check it out.

Good luck! :slightly_smiling_face:

okay ill go check it out etyjv