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

How do you save tools when leaving the server?

How can u save your data of tools I made a button that will give sword if you have 1000 Coins and put it on Backpack and Starter Gear But it won't save when i leave the server and rejoin back again I want to save it but I don't know how to save it please help me.

1 comment

0

why no show script?, anyway, use datastore service to set async of the tools name, and when a player joins clone the tool to their starter gear and backpack if they have, so like if savedTools:GetAsync(plr.UserId)~=nil then game.ServerStorage.Tools[savedTools:GetAsync(plr.UserId)]:Clone().Parent=plr.Backpack game.ServerStorage.Tools[savedTools:GetAsync(plr.UserId)]:Clone().Parent=plr.StarterGear E

3 answers

Check this service DataStoreService as well as theses functions UpdateAsync and GetAsync. They will help you. There are code samples at the end of these pages too.

Take into account you can't save Instances, but you can save a value like a string or a boolean value to know if someone should have the item, and then give it to them.

You can't exactly save a tool using the DataStoreService, but what you can do is save a value, such as a string or a number that identifies what tool they have upon leaving. Then, you will be able to add the tool to the players backpack once they joined. If this is the answer you needed, please accept my answer! If you need any more help, feel free to ping me in the community chat. Thanks!

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