how do i make it so that people dont loose there item?
this works in the way that the player gets the item and when he/she resets/dies they will get it in there inventory and what doesn't work is that other players when they die the item stays in server storage and its a problem when it leaves the inventory, in general, how would I fix this thank you
01 | local gamepassid_ = 10022825 |
02 | local b = game:GetService( "ServerStorage" ):FindFirstChild( "GravityCoil" ):Clone() |
05 | game.Players.PlayerAdded:Connect( function (player) |
06 | if game:GetService( "MarketplaceService" ):UserOwnsGamePassAsync(player.UserId, 10022825 ) then |
07 | if player.Backpack:FindFirstChild( "GravityCoil" ) = = nil then |
08 | game.ServerStorage:FindFirstChild( "GravityCoil" ):Clone() |
09 | b.Parent = player.Backpack |
15 | game:GetService( 'Players' ).PlayerAdded:Connect( function (player) |
16 | player.CharacterAdded:Connect( function (character) |
17 | character:WaitForChild( "Humanoid" ).Died:Connect( function () |
19 | game:GetService( "ServerStorage" ):FindFirstChild( "Gravitycoil" ):clone() |
22 | if game:GetService( "MarketplaceService" ):UserOwnsGamePassAsync(player.UserId, 10022825 ) then |
23 | if player.Backpack:FindFirstChild( "GravityCoil" ) = = nil then |
24 | game.ServerStorage:FindFirstChild( "GravityCoil" ):Clone() |
25 | b.Parent = player.Backpack |