#item data store problem

1 messages · Page 1 of 1 (latest)

fallen flower
#

how do i make it that tools doesn't disappear on leave/reset? Devforum says to use UnequipTools() but it doesn't work....

(this code is not a full code)

game.Players.PlayerRemoving:Connect(function(player: Player)
    save(player)

    if playerdata[player] then
        table.clear(playerdata[player])
    end
    
    player.CharacterRemoving:Connect(function(char)
        char:FindFirstChildOfClass("Humanoid"):UnequipTools()
    end)
    
    playerdata[player] = nil
end)
rustic tundra
#

Oh wait do you want it to unequip like that or do you want all their tools to drop in front of them?

fallen flower
strange oysterBOT
#

studio** You are now Level 1! **studio

fallen flower
#

(yes it saves on leave but item you hold is disappearing)

rustic tundra
#

Like you want it to keep being held?

fallen flower
# rustic tundra Wdym

when i hold an item, it disappears on leaving/resetting, but other items are being saved

rustic tundra
#

Ohh

fallen flower
#

im wondering how to make it not disappear on leaving or resetting

rustic tundra
#

So youre saying it isnt saving?

fallen flower
#

and if you do it with other items they disappear too

rustic tundra
#

Okay i get it now

#

Can i see your saving code?

#

And loading

fallen flower
rustic tundra
#

Send it as a file

fallen flower
#

alr

fallen flower
hollow crag
#

Im pretty sure when you hold the tool the tool will move from the backpack to the character

hollow crag
#

So you can try finding the tool inside of the player character and save it

rustic tundra
#

Yeah thats why i wanna see their code

fallen flower
rustic tundra
#

Yh it looks all fine

#

Like vice said in your saving code find a model in the players character which is of itemclass tool

#

But idk if thatwill work if the person leaves

#

So a better way i think is

fallen flower
#

I'm just new to Roblox studio really no idea what to do

rustic tundra
#

Check when a tool is added to the players backpack

#

When that runs add it to a table that has the all the players items in it

#

When a tool is removed remove it from the table

#

And add a copy of every tool in serverstorage

#

When they load in

#

You can read the table

#

And clone a copy of all their tools into their backback from serverstorage

#

I made something like this once hold on