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!
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!
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
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
This is not fully finished, if you did not know that.
Do I place both into the same script?
No. You make the Save activate after the user buys and item. Then loading goes in workspace.