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?
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.
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