|
| 16 Dec 2011 10:08 PM |
function onTouched(part) if part.Parent.Name == "Ball" then part.Position = BallPos.Position end end
script.Parent.Touched:connect(onTouched)
No error, but dont work?
I want the ball when it touches to teleport where the BallPos brick is.
|
|
|
| Report Abuse |
|
|
|
| 16 Dec 2011 10:09 PM |
| did you define the variable BallPos? |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
| |
|
|
| 16 Dec 2011 10:09 PM |
| Its a brick... I just told you the name of that brick |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 16 Dec 2011 10:10 PM |
| BallPos = game.Workspace.BallPos |
|
|
| Report Abuse |
|
|
Zlavaz
|
  |
| Joined: 23 Oct 2011 |
| Total Posts: 2722 |
|
|
| 16 Dec 2011 10:11 PM |
BallPos = game.Workspace.BallPos
function onTouched(part) if part.Parent.Name == "Ball" then part.Position = BallPos.Position end end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
|
| 16 Dec 2011 10:13 PM |
| Ok, I am using zlavaz's script but its not working? |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 16 Dec 2011 10:16 PM |
Make sure BallPos is named EXACTLY BallPos and its Parent is Workspace, if it is in a Model... BallPos = game.Workspace.MODEL.BallPos |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2011 10:29 PM |
| It is called Exactly 'BallPos'. |
|
|
| Report Abuse |
|
|
itunes89
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 1957 |
|
| |
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 16 Dec 2011 10:37 PM |
i'm thinking the error is in the: if part.Parent.Name == "Ball" then Is brick that is being teleported called Ball, or is a part called Ball within a model/object touching the thing? I'm thinking change "part.Parent.Name" to "part.Name" |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2011 10:38 PM |
| BallPos is in the workspace and the Brick called 'Ball'. |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2011 10:40 PM |
-mage
Thanks!! That worked :D!!! |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 16 Dec 2011 10:59 PM |
| No problem, glad I helped :) |
|
|
| Report Abuse |
|
|