Hi. I have a game where players collect items and kill players but when a player dies all there items are deleted and I don't want it to do that. Please tell me on how I should do this.
COMMUNITY QUESTION
How to keep inventory when a humanoid dies?
1 answer
Here's how to go about this because you can't ask for scripts on this site. Firstly, create a local script in StarterPlayerScripts. Make a remote event fire when the humanoid dies. Create a script in ServerScriptService and script a function, which is triggered when the remote event is fired. Make the function save the players items to a datastore, and when the player respawns, give it back to them. Hope this helps!
2 comments
0
ok that shouldnt be too hard ill let you know if it works
0
Ok!
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Use both the Backpack and the StarterGear. Basically, you clone two tools that will go to Backpack and the StarterGear. https://developer.roblox.com/en-us/api-reference/class/StarterGear