Lerorno
|
  |
| Joined: 16 Jul 2014 |
| Total Posts: 278 |
|
|
| 31 Jan 2015 11:24 AM |
I am trying to destroy the players backpack tools after one second of death. This is what i have:
Humanoid = script.Parent.Parent.Character.Humanoid g = script.Parent:GetChildren()
if Humanoid.Health == 0 then wait(1) script.Parent.g:Destroy() end
|
|
|
| Report Abuse |
|
|
Lerorno
|
  |
| Joined: 16 Jul 2014 |
| Total Posts: 278 |
|
|
| 31 Jan 2015 11:27 AM |
| This is a StarterPack script btw. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2015 11:31 AM |
Why? Tools in the Backpack reset when a new character is created anyway. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2015 11:38 AM |
-- Put this into Workspace or ServerScriptService.
game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() wait(1) for i,v in pairs(player.Backpack) do if v:IsA('Tool') or v:IsA('HopperBin') then v:destroy() end end) end) end) |
|
|
| Report Abuse |
|
|
Lerorno
|
  |
| Joined: 16 Jul 2014 |
| Total Posts: 278 |
|
|
| 31 Jan 2015 11:43 AM |
| Reason being s that when the player dies, some tools used in the game flood into their backpack. |
|
|
| Report Abuse |
|
|