I'm making a game and i wan tall the guys when they died they loose there items in the backpack.
ClearAllChildren()
and
1 | game:GetService( 'Players' ).PlayerAdded:connect( function (player) |
2 | player.CharacterAdded:connect( function (character) |
3 | character:WaitForChild( "Humanoid" ).Died:connect( function () |
4 | print (player.Name .. " has died!" ) |
5 | end ) |
6 | end ) |
7 | end ) |
Hi. I made this script for you.
Script:
01 | Players = Game:GetService( "Players" ) |
02 |
03 | Players.PlayerAdded:connect( function (Player) |
04 | Player.CharacterAddedd:connect( function (Character) |
05 |
06 | Humanoid = Character:FindFirstChild( "Humanoid" ) |
07 | Backpack = Player:FindFirstChild( "Backpack" ) |
08 |
09 | Humanoid.Died:connect( function () |
10 | Backpack:Destroy() |
11 | end ) |
12 | end ) |
13 | end ) |
I hope it works for you. Enjoy.