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

How can I save a player's in-game earned gear?

In my game, players can use in-game currency to purchase fun gears. I would like to know how I can save a player's in-game gear when they leave and join the game.

Thank you!

1 answer

Hai cyclox You can change Tool to anything but you also gotta change in Loading sequence

Saving Below

	if game.Players.LocalPlayer:WaitForDataReady() then
	player = game.Players.LocalPlayer
	player:WaitForChild("Backpack")
	player:SaveInstance("Tool", player:FindFirstChild("Backpack"):FindFirstChild("ToolName"))
	end

Loading Below

game.Players.PlayerAdded:connect(function(player)
    if player:WaitForDataReady() then -- Wait for the player's data cache to load or skip if it doesn't
        print(player:LoadInstance("Tool"))
    end
end)

IMPORTANT: You will have to add the Save feature to activate when the player bought the item

3 comments

0

This is not fully finished, if you did not know that.

0

Do I place both into the same script?

0

No. You make the Save activate after the user buys and item. Then loading goes in workspace.

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