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: Tool sensor?

Previous Thread :: Next Thread 
Cilverix is not online. Cilverix
Joined: 17 Jul 2014
Total Posts: 2923
01 Sep 2017 05:24 PM
How do you make it so if the tool name is something specific it runs a piece of code?

I've tried:

Sensor = script.Parent

Sensor.Touched:Connect(function(part)
if part.Name == "101" then
print("Granted")
Sensor:Destroy()
end
end)
Report Abuse
LeafDoode is not online. LeafDoode
Joined: 29 May 2017
Total Posts: 3094
01 Sep 2017 05:28 PM
um is "Sensor" the tool?
Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
01 Sep 2017 05:44 PM
Sensor is script.Parent (the block being touched)


Sensor.Touched:Connect(function(part)
if part.Parent.Name == "101" then
print("Granted")
Sensor:Destroy()
end
end)

you were close, tools don't have a physical property so lets say you're using the handle of the tool (handle is a child of tool) so the part touched then that objects parent


attempt to index global 'soul' (a nil value)
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