#Preserve Gear upon player death.

1 messages · Page 1 of 1 (latest)

elder mango
#

I have a weapon loadout system in my game and I want the weapons/gear to stay in the player's inventory when they die. Here is the code I have right now:

local Startergui = game:GetService("StarterGui")

Humanoid.Died:Connect(function()
    Startergui:SetCoreGuiEnabled("Backpack",false)
    Humanoid:UnequipTools()
    repeat task.wait(0.1) until Humanoid.Health > 0
    Startergui:SetCoreGuiEnabled("Backpack",true)
end)```
quiet vale
#

it won't be the same humanoid when they actually respawn

elder mango
quiet vale
#

you'll probably need to move the tools out of the backpack wait for a new character to spawn and add them back to the backpack

elder mango
#

What would be the best way to do that?

fallow joltBOT
#

studio** You are now Level 2! **studio

quiet vale
#

i dont' really want to write it out rn, do your best 👍

elder mango
hardy panther
#

But like

#

This seems like a very ai-able question

#

Use that as a base code

elder mango
#

That's what ive been trying

#

Chatgpt is just literally wrong tho

hardy panther
elder mango
#

Basically I want what ever starterpack the player had before death to stay

hardy panther
elder mango
#

Ehhhhh not much really

#

I've had a friend helping me but they had to get off