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
|
  |
| Joined: 29 May 2017 |
| Total Posts: 3094 |
|
| |
|
|
| 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 |
|
|