Tool Saving Error

Hello Iam Sam
Today iam trying to make a Tool Saving system!
So I want to make a system that whenever u leave the game it will store the tool and give u back when u join again
I have tried many tutorials but havent found a working one for my game
Here is the one iam using do you find any error ?


Or any tutorial suggesting is appriciated
Thanks

Everything seems okay. Does it print any errors in the output?

No it doesnt print anything
Doesnt print the Done at line 16 too

Try changing the definition of toolsFolder.

local toolsFolder = game:GetService("ReplicatedStorage"):WaitForChild("Tools")

and add a print(toolSaved) somewhere in the loop.

You’re pairing through the toolsDB variable, you can’t loop through a GetAsync, instead, assign a value to the player, once a player owns it, make it TRUE, after that, when a player joins, check for that value and if it’s true, give the tool. (e.g clone it)

Yeah i made a new script


But when i leave (already bought it and i see the value is true already) but after rejoined its false and doesnt give tool

You’re not assigning the player to the table once the player leaves.

Here’s the correct version:

game.Players.PlayerRemoving:Connect(function(player)
    db:SetAsync(player.UserId.."-ownstool1", player.Oranges.ownsTool1.Value)
end)

Hey! where should i put it ? ggnno
Edit that is for enough 30 words lol
edit 2 already see let me test

Change this:
image

with:

game.Players.PlayerRemoving:Connect(function(player)
    db:SetAsync(player.UserId.."-ownstool1", player.Oranges.ownsTool1.Value)
end)

Can i ask why we have to write it ?

Write what?

303030303030303030303030

the “-ownstool1” what is that using for ?
edit that would be the alst question it worked lol
Edit 2 Do u know how to make it work for multiple tool ?
Edit 100 i made it work for only an orange how do i make it like there are 3 oranges (tool) And it only give the strongest ?

1:

When the player joins, you’re checking for data on the following table:

Player.UserId.."-ownstool1" --the user id, and the table. (output: 442540778-ownstool1)

When a player leaves, you’ll assign something to that table, and if a player rejoins, you repeat the process of checking again.

2:
Make multiple tables, e.g:

Player.UserId.."-ownstool2"
Player.UserId.."-ownstool3"

Just make sure to assign it correctly, and check when a player joins

You are great thanks for helping me
Hope we can meet Again
i hope the Solution mark and this Cookie :cookie: worth your prize Thanks

This could also help