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 » Scripters
Home Search
 

Re: How would you change the velocity of a block on touch?

Previous Thread :: Next Thread 
Markilo is not online. Markilo
Joined: 27 Dec 2013
Total Posts: 6534
28 Jun 2016 03:18 AM
So I'm making a roller coaster/ride that uses track, I normally use this script:

script.Parent.Velocity = script.Parent.CFrame.lookVector*300

How would I make it so it would become -300 on touch of a brick (so when the cart hits it it will switch so the track reverses and goes opposite direction)


R$2,750 AKA dustyshirt
Report Abuse
Andyliu5000 is not online. Andyliu5000
Joined: 02 Nov 2013
Total Posts: 969
28 Jun 2016 03:30 AM
Script.Parent.CFrame.lookVector:inverse() * 300?
Report Abuse
dustyshirt is not online. dustyshirt
Joined: 15 Jan 2012
Total Posts: 15431
28 Jun 2016 01:45 PM
Bump


Andy, I don't think that would work unless you could do wait() so it would switch at a certain time


R$0 AKA dustyshirt
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
28 Jun 2016 01:52 PM
part.Touched:connect(function(hit)
--check if hit is the cart
cart.Velocity=cart.CFrame.lookVector*-300
end)


Report Abuse
dustyshirt is not online. dustyshirt
Joined: 15 Jan 2012
Total Posts: 15431
28 Jun 2016 01:54 PM
thank you, i will test that and get back to you


R$0 AKA dustyshirt
Report Abuse
dustyshirt is not online. dustyshirt
Joined: 15 Jan 2012
Total Posts: 15431
28 Jun 2016 02:02 PM
uhhh, didn't work


R$0 AKA dustyshirt
Report Abuse
dustyshirt is not online. dustyshirt
Joined: 15 Jan 2012
Total Posts: 15431
28 Jun 2016 02:04 PM
nvm




that track has the velocity not the cart


R$0 AKA dustyshirt
Report Abuse
dustyshirt is not online. dustyshirt
Joined: 15 Jan 2012
Total Posts: 15431
28 Jun 2016 02:05 PM
meaning the track SHOULD have the velocity


rip



i think i messed up, brb ill get back if i did or didnt


Report Abuse
dustyshirt is not online. dustyshirt
Joined: 15 Jan 2012
Total Posts: 15431
28 Jun 2016 02:06 PM
nvm, still didn't work


Report Abuse
dustyshirt is not online. dustyshirt
Joined: 15 Jan 2012
Total Posts: 15431
28 Jun 2016 02:12 PM
bump, i'm going to elaborate a little more as i feel i'm being too vague of what i'm asking for




the cart is on the track, the track has the velocity and detector script, there are 2 blocks named detector, so when hit in theory velocity should switch and reverse until next detector is hit



i don't know if i'm messing up since i've quite inexperienced at scripting or i'm just plain dumb, which either is the case i'd highly appreciate help


Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
28 Jun 2016 02:16 PM
script.Parent.Velocity = -script.Parent.CFrame.lookVector*300


Report Abuse
dustyshirt is not online. dustyshirt
Joined: 15 Jan 2012
Total Posts: 15431
28 Jun 2016 02:17 PM
Yes that's the script I use for velocity ?


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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