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 » Scripting Helpers
Home Search
 

Re: Cart help.

Previous Thread :: Next Thread 
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 03:27 PM
I have a pretty complicated problem. I am creating a game that depends on xLEGOx's cart ride tracks and cart. The carts automatically regen. The problem I am having is that I am trying to make a part of the rail that when touched by a cart, the cart will stop. The script for this cart is:

touched = false

function onTouched(hit)
if not touched then
touched = true
game.Workspace.Cartlol3.Speed.Value=0
wait(11)
game.Workspace.Cartlol3.Speed.Value=15
wait(0.1)
game.Workspace.Cartlol3.CanCollide=false
touch = false
end
end
script.Parent.Touched:connect(onTouched)


This script works on the original Cartlol3. However, once the cart is cloned by my automatic regen script, the clones will not stop when they touch the stopping part. The regen script is a standard cloning thing. Does anyone have any idea why
The original cart is the only one to stop?



















































































































































































































Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 03:30 PM
Bump.
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 03:35 PM
I really need help.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
19 Apr 2014 03:55 PM
(You should of done touched = false but that's beside the point)

Your problem is that you are indexing the first one it finds in workspace instead of actually indexing the one that touches it.
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 03:58 PM
How could I fix this?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
19 Apr 2014 04:00 PM
You're going to have to structure the model in a way that whatever touches it, you know the amount of parents you are going to need to get to the location where the value "Speed" is. Or you could do it inefficiently.

Anyway, it might be like: hit.Parent.Parent.Parent.Speed.Value = blah
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 04:03 PM
So the mroe cartsthere are the more parents I put?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
19 Apr 2014 04:05 PM
No.

If your cart hierachy looks like this:

-cart
--speed
--parts...

Then you only need 1 parent, but if the parts are in another model, 2, etc.
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 04:10 PM
But wouldn't the system still look for the first cart because all the carts have the same amount of parents?
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
19 Apr 2014 04:11 PM
Is this script even in the cart?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
19 Apr 2014 04:12 PM
OP, before scripting please try to understand what the Parent property even is.

Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 04:14 PM
Can you give me the script please?
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 04:26 PM
bump
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
19 Apr 2014 04:27 PM
Look at Cnts post.
Go along now, Do your research.
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 04:29 PM
Can you please just tell me?
I am really lazy.
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
19 Apr 2014 04:35 PM
http://wiki.roblox.com/index.php?title=Parent
Laziness is not a valid excuse. If you want this you`ll have to work for it. One does not simply skip the basics.
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 04:37 PM
Do you even know how to script?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
19 Apr 2014 04:41 PM
Says the one who wants everything done for him...
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 04:42 PM
Anyway, I know what parents are. I don't know how to use them in this situation.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
19 Apr 2014 04:44 PM
When a piece of the car touches the brick, the brick will go up some and then speed will be there...
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 04:48 PM
Sorry, I still don't get you.
Report Abuse
BrandzvietBoi is not online. BrandzvietBoi
Joined: 27 Feb 2011
Total Posts: 27
19 Apr 2014 04:52 PM
Been funny reading this
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
19 Apr 2014 04:53 PM
Scenario:

Cart wheel touches part, cart wheel is located in cart.wheels.
hit.Parent.Parent.Speed (wheel.Parent = wheels.Parent = cart)
Report Abuse
wantedfunnybunny is not online. wantedfunnybunny
Joined: 10 Apr 2012
Total Posts: 466
19 Apr 2014 04:55 PM
I get what you are saying now, but how do I make this in a touched script?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
19 Apr 2014 04:56 PM
I basically already did that line
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