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)```
** You are now Level 2! **