generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: ok so

Previous Thread :: Next Thread 
SoulWill is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image