peaspod
|
  |
| Joined: 29 Sep 2010 |
| Total Posts: 2809 |
|
|
| 03 Nov 2012 04:15 PM |
I have this but it doesn't work:
function onTouched(hit) tools = hit.BackPack:GetChildren() for i = 1,#tools do tools[i]:Remove() end end script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 04:18 PM |
function onTouched(hit) if hit.Parent:findFirstChild("Humanoid") then tools = hit.Parent.Backpack:GetChildren() for i = 1,#tools do tools[i]:Remove() end end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
Monkey727
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 969 |
|
|
| 03 Nov 2012 04:23 PM |
function onTouched(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then player = game.Players:GetPlayerFromCharacter(hit.Parent) tools = player.Backpack:GetChildren() for i = 1,#tools do tools[i]:Remove() end end end script.Parent.Touched:connect(onTouched)
I believe. |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 04:28 PM |
function onTouch(hit) character = hit.Parent if game:GetService("Players"):GetPlayerFromCharacter(character) then player = game:GetService("Players"):GetPlayerFromCharacter(character) tools = player.Backpack for _,a in pairs(tools) do if a:IsA("Tool") or a:IsA("HopperBin") then a:remove() end end end end
Basically what Monkey put. |
|
|
| Report Abuse |
|
|