SoulWill
|
  |
| Joined: 12 Mar 2011 |
| Total Posts: 559 |
|
|
| 14 Aug 2015 06:51 PM |
I want it so a tool deletes a certain brick when touched, I don't know what I have to do to do that but this is my script:
function onTouch(Touched) if Touched.Parent.Name == "Brick" then script.Parent:remove() else end end
script.Parent.Touched:connect(onTouch)
~http://www.roblox.com/games/225000248/The-Cave-ALPHA#!/about~ |
|
|
| Report Abuse |
|
|
Qaynar
|
  |
| Joined: 01 Feb 2015 |
| Total Posts: 486 |
|
|
| 14 Aug 2015 06:52 PM |
script.Parent.Touched:connect(function(hit) -- Just shorter and same thing
if Touched.Parent.Name == "Brick" then script.Parent:Destroy() else end end
end) |
|
|
| Report Abuse |
|
|
Qaynar
|
  |
| Joined: 01 Feb 2015 |
| Total Posts: 486 |
|
|
| 14 Aug 2015 06:53 PM |
| Also :remove() is the older way and not as good for some reason, use :Destroy(). |
|
|
| Report Abuse |
|
|
SoulWill
|
  |
| Joined: 12 Mar 2011 |
| Total Posts: 559 |
|
|
| 14 Aug 2015 06:58 PM |
still not working :(((
~http://www.roblox.com/games/225000248/The-Cave-ALPHA#!/about~ |
|
|
| Report Abuse |
|
|
SoulWill
|
  |
| Joined: 12 Mar 2011 |
| Total Posts: 559 |
|
|
| 14 Aug 2015 07:14 PM |
bumpumpump
~http://www.roblox.com/games/225000248/The-Cave-ALPHA#!/about~ |
|
|
| Report Abuse |
|
|
Drakles
|
  |
| Joined: 19 Oct 2014 |
| Total Posts: 1066 |
|
|
| 14 Aug 2015 07:16 PM |
local tool = script.Parent;
local part = tool:WaitForChild("partNameHere")
part.Touched:connect(function(hit) if hit.Name == "nameHere" then hit:Destroy() end end
Life is short, so grip it and rip it. |
|
|
| Report Abuse |
|
|
SoulWill
|
  |
| Joined: 12 Mar 2011 |
| Total Posts: 559 |
|
|
| 14 Aug 2015 07:20 PM |
nope :(((((((((((((((
~http://www.roblox.com/games/225000248/The-Cave-ALPHA#!/about~ |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 14 Aug 2015 07:21 PM |
| it's working it's just not working as you want right |
|
|
| Report Abuse |
|
|
SoulWill
|
  |
| Joined: 12 Mar 2011 |
| Total Posts: 559 |
|
|
| 14 Aug 2015 07:22 PM |
yeah and that's the point of this thread
~http://www.roblox.com/games/225000248/The-Cave-ALPHA#!/about~ |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 14 Aug 2015 07:28 PM |
| because for example your script destroys the tool |
|
|
| Report Abuse |
|
|
SoulWill
|
  |
| Joined: 12 Mar 2011 |
| Total Posts: 559 |
|
|
| 14 Aug 2015 07:31 PM |
actually it doesn't do anything stop making assumption >:(((
~http://www.roblox.com/games/225000248/The-Cave-ALPHA#!/about~ |
|
|
| Report Abuse |
|
|
Qaynar
|
  |
| Joined: 01 Feb 2015 |
| Total Posts: 486 |
|
|
| 14 Aug 2015 07:39 PM |
Okay, put this code in a script, inside a tool, NOT inside of something inside a tool, just inside a tool.
Make sure there is a brick called "Handle" in the Tool.
script.Parent.Handle.Touched:connect(function(hit)
if hit.Name == "Brick" then hit:Destroy() else end
end) |
|
|
| Report Abuse |
|
|
SoulWill
|
  |
| Joined: 12 Mar 2011 |
| Total Posts: 559 |
|
|
| 14 Aug 2015 07:42 PM |
Ik I done all that but it still doesn't work, the tool is just a basic stick pointing out.
~http://www.roblox.com/games/225000248/The-Cave-ALPHA#!/about~ |
|
|
| Report Abuse |
|
|
SoulWill
|
  |
| Joined: 12 Mar 2011 |
| Total Posts: 559 |
|
|
| 14 Aug 2015 08:00 PM |
bumummmpppumpppp
~http://www.roblox.com/games/225000248/The-Cave-ALPHA#!/about~ |
|
|
| Report Abuse |
|
|