|
| 10 Jul 2015 10:15 PM |
This is terrible
but
function touch(hit) if hit.Parent.Classname == "Hat" then hit.Parent.Hat:Destroy() end end
script.Parent.Touched:connect(touch)
I want it to delete a hat if it finds it |
|
|
| Report Abuse |
|
|
C1F8
|
  |
| Joined: 15 Apr 2013 |
| Total Posts: 240 |
|
|
| 10 Jul 2015 10:16 PM |
Try this: function added(child) if child:IsA("Hat") then child:destroy() end end workspace.ChildAdded:connect(added) |
|
|
| Report Abuse |
|
|
Irradiant
|
  |
| Joined: 31 May 2012 |
| Total Posts: 56114 |
|
|
| 10 Jul 2015 10:31 PM |
game.Workspace.ChildAdded:connect(function(newChild) if newChild.ClassName == "Hat" then newChild:Destroy() end end)
ROBUX: R$11,691 |
|
|
| Report Abuse |
|
|
Cmaj7
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 36653 |
|
| |
|
|
| 10 Jul 2015 10:51 PM |
I want it so when you touch a block that happens
"game.Workspace.ChildAdded:connect(function(newChild) if newChild.ClassName == "Hat" then newChild:Destroy() end end) "
So that doesnt work |
|
|
| Report Abuse |
|
|
Irradiant
|
  |
| Joined: 31 May 2012 |
| Total Posts: 56114 |
|
|
| 10 Jul 2015 10:53 PM |
If you want it to remove your hats when you touch a brick then
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then for i, hat in ipairs(hit.Parent:GetChildren()) do if hat.ClassName == "Hat" then hat:Destroy() end end end end)
ROBUX: R$11,691 |
|
|
| Report Abuse |
|
|
| |
|