Swapping inventories and avatars on kill; how would I go about doing that?

Hey, developers.

I’m slowly learning to script, and I’ve come across a question when playing around with some assets.

Would it be possible to script it where when you kill a player, when they’ve died, you receive their inventory of items and avatar? (Like swapping, but only you get the swap)

And where would I start with that? Links I can check out?

Thanks!

You could probably use Humanoid:GetAppliedDescription() and Humanoid:ApplyDescription(). Edit: And the inventory swapping could be done getting the killed player’s tools with player.Backpack:GetChildren() and setting the parent of each to the killer’s backpack. And if you want to first destroy the killer’s current tools, you can use :ClearAllChildren().

1 Like