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: Move up by

Previous Thread :: Next Thread 
t_p0t is not online. t_p0t
Joined: 18 Dec 2011
Total Posts: 11
17 Jul 2016 03:00 PM
Sorry about the nooby question, I've been building for a while and I've just recently started getting into scripting. I was wondering if there was a way to instead of create a new CFrame very time you want to move a part use some other command to just move it up by some certain amount.

EXAMPLE:

function onTouch(hit)
repeat
script.Parent.CFrame.MoveUpBy (0,5)
until script.Parent.Position = (0,5,0)

end
script.Parent.Touched:connect(onTouch)

Like I said, I'm very new to this, and most of that is probably wrong, corrections appreciated.
Report Abuse
Titanicman882ftlong is not online. Titanicman882ftlong
Joined: 14 Aug 2012
Total Posts: 430
17 Jul 2016 03:02 PM
function onTouch(hit)
repeat
script.Parent.CFrame = CFrame.new(script.Parent.CFrame + Vector3.new(0, 1, 0)
wait()
until script.Parent.Position = (0, 5, 0)
end

script.Praent.Touched:connect(onTouch)
Report Abuse
pinballboy7 is not online. pinballboy7
Joined: 12 Mar 2009
Total Posts: 1485
17 Jul 2016 03:03 PM
repeat
script.Parent.CFrame=script.Parent.CFrame+Vector3.new(0,5,0)
until script.Parent.CFrame.p=Vector3.new(0,5,0)
Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
17 Jul 2016 03:04 PM
@Titanic

you misspelled parent rip

function onTouch(hit)
repeat
script.Parent.CFrame = CFrame.new(script.Parent.CFrame + Vector3.new(0, 1, 0)
wait()
until script.Parent.Position = (0, 5, 0)
end

script.Parent.Touched:connect(onTouch)
Report Abuse
t_p0t is not online. t_p0t
Joined: 18 Dec 2011
Total Posts: 11
17 Jul 2016 05:57 PM
Figured it out, edited some of the code you guys sent.

a = 9
function onTouch()
repeat
script.Parent.Position = Vector3.new(0,a,0)
a = a + 1
wait(1)
until a == 16
wait (1)
repeat
script.Parent.Position = Vector3.new(0,a,0)
a = a - 1
wait(1)

until a == 9

end

script.Parent.Touched:connect(onTouch)

some of it wasn't working and I had to patch it up, I can change the value of a and the wait time to make it move smoother.
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