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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Please fix this simple script...

Previous Thread :: Next Thread 
JohnElijah is not online. JohnElijah
Joined: 06 May 2009
Total Posts: 1629
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
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
16 Dec 2011 10:09 PM
did you define the variable BallPos?
Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
16 Dec 2011 10:09 PM
BallPos isn't defined.
Report Abuse
JohnElijah is not online. JohnElijah
Joined: 06 May 2009
Total Posts: 1629
16 Dec 2011 10:09 PM
Its a brick... I just told you the name of that brick
Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
16 Dec 2011 10:10 PM
BallPos = game.Workspace.BallPos
Report Abuse
Zlavaz is not online. 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
JohnElijah is not online. JohnElijah
Joined: 06 May 2009
Total Posts: 1629
16 Dec 2011 10:13 PM
Ok, I am using zlavaz's script but its not working?
Report Abuse
mage11561 is not online. 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
JohnElijah is not online. JohnElijah
Joined: 06 May 2009
Total Posts: 1629
16 Dec 2011 10:29 PM
It is called Exactly 'BallPos'.
Report Abuse
itunes89 is not online. itunes89
Joined: 19 Jan 2011
Total Posts: 1957
16 Dec 2011 10:34 PM
Is it parent workspace?
Report Abuse
mage11561 is not online. 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
JohnElijah is not online. JohnElijah
Joined: 06 May 2009
Total Posts: 1629
16 Dec 2011 10:38 PM
BallPos is in the workspace and the Brick called 'Ball'.
Report Abuse
JohnElijah is not online. JohnElijah
Joined: 06 May 2009
Total Posts: 1629
16 Dec 2011 10:40 PM
-mage

Thanks!! That worked :D!!!
Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
16 Dec 2011 10:59 PM
No problem, glad I helped :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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