|
| 26 Dec 2015 01:29 PM |
Okay.. it was working when i did game.Workspace.. but I changed it up and now not functioning
function OnTouched() print("I've run into something!") end part.Touched:connect(OnTouched)
|
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:30 PM |
part = script.Parent
^--- Forgot to add that so fulls cript again
part = script.Parent function OnTouched() print("I've run into something!") end part.Touched:connect(OnTouched)
|
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:33 PM |
| Is the scripts parent ACTUALLY the part? |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:35 PM |
| Yes I got the parenting correct. |
|
|
| Report Abuse |
|
|
| |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 26 Dec 2015 01:39 PM |
Script.Parent.Touched:connect(function(SomethingIsTouchingMeOMG) print("I NEED AN ADULT") end) |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:39 PM |
Here is a place.
http://www.roblox.com/games/336135286/uncopylocked-testing |
|
|
| Report Abuse |
|
|
cbhusker
|
  |
| Joined: 07 Feb 2011 |
| Total Posts: 517 |
|
|
| 26 Dec 2015 01:39 PM |
part.Touched:connect(function() print("I've run into something!") end)
print("Hello World!") |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 26 Dec 2015 01:55 PM |
all of the above should be working
it's gotta be some unknown variable on your end - are you using a Local Script? Is the script active? Where is the script located, is it truly a child of the part? |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 02:25 PM |
| ^ I made an uncopylocked place check it out. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 02:45 PM |
| http://www.roblox.com/games/336135286/uncopylocked-testing |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 02:46 PM |
Your other part of the script is invalid so the OnTouched will not work
-Aerbin |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 02:48 PM |
script.Parent:connect(function(otherPart) print(otherPart) otherPart:Destroy() end)
This is invalid
-Aerbin |
|
|
| Report Abuse |
|
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
|
| 26 Dec 2015 03:08 PM |
here, this is the right code:
part = script.Parent
script.Parent.Touched:connect(function(otherPart) print(otherPart) otherPart:Destroy() end)
function OnTouched() print("I've run into something!") end part.Touched:connect(OnTouched)
|
|
|
| Report Abuse |
|
|