Keep tools when player is reloaded

Hallo!

I’m currently developing a game that frequently uses :LoadCharacter(). However, I’m having an issue with player tools. When a player is reloaded or dies, their tools disappear.

In my game, players purchase tools from a shop, and it’s preferred that these tools are kept even after reloading or death.

Does anyone have any suggestions or solutions to counteract this problem?

Thanks in advance!

Add them to the table after purchase, for example in a modular script. After the player dies, restore them to his inventory. For this, you can use the CharacterAdded event, after the player’s character appears in the game(for example, after death) it will trigger.

1 Like

The easiest solution would be to parent the Tool to the player’s StarterGear rather than their Backpack, as an example:

local Players = game:GetService("Players")

local tool = script.Tool

local function onPlayerAdded(player)
	tool:Clone().Parent = player.StarterGear
end

Players.PlayerAdded:Connect(onPlayerAdded)

Tools parented to the player’s StarterGear will automatically be placed in their backpack each time they die or reset

Also make sure to do so within a server script :slight_smile::+1:

1 Like

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