How to save backpack tools

this is self explanatory. I dont know where to begin.

3 Likes

Do you mean something like the Player getting their tools back when they die in-game?

1 Like

Yes, and also when they leave the game and rejoin

For Players getting their tools back when they die, you can simply modify the script which gives the Player the tool, and clone the tool to add to the Player’s StarterGear. Read about StarterGears here.

As for saving a Player’s backpack to a Datastore, you may read this separate Community Tutorial, which focuses more in depth on how to do so.

Happy Scripting!

Thanks you for the advices and links, i’ll try it!

1 Like

I was gonna ask a question, but why did you deleted it?

Because you found the solution already, but what was the question

ah no i missclicked sorry lol but i was gonna ask : “local toolsFolder = game.ServerStorage.ToolsFolder --location of the Tools” can i change the locations of the tools to plr.Backpack? bc i want to save the playerBackpack not a folder in server storage

I thank so but the script all ready saves the Backpack

ohh so what is toolsFolder for

It should contain all the tools in the game

Here is a script in workspace that if you touch it, it clones a tool from a folder from replicated storage in plr backpack.

local debounce = false

function getPlayer(humanoid) 
local players = game.Players:children() 
for i = 1, #players do 
if players[i].Character.Humanoid == humanoid then return players[i] end 
end 
return nil 
end 

function onTouch(part) 

local human = part.Parent:findFirstChild("Humanoid") 
if (human ~= nil) and debounce == false then

debounce = true

local player = getPlayer(human) 

if (player == nil) then return end 

		local clone = game.ReplicatedStorage.Tools:WaitForChild("Glasses"):Clone()
clone.LocalScript.Enabled = true
clone.Parent = player.Backpack

wait(5)
debounce = false
end
end


script.Parent.Touched:connect(onTouch) 

maybe i need to put toolsFolder to the folder in replicated storage

nope, doesnt work. Im gonna try MsDeborah method

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.