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: Any way to make a script like this a lot shorter?

Previous Thread :: Next Thread 
Curozilla is not online. Curozilla
Joined: 18 Jun 2014
Total Posts: 2219
28 Sep 2014 06:03 PM
local BALL = script.Parent
while true do
BALL.CFrame = CFrame.new(-255, 11, -52)
wait(0.1)
BALL.CFrame = CFrame.new(-255, 11, -51)
wait(0.1)
BALL.CFrame = CFrame.new(-255, 11, -50)
wait(0.1)
BALL.CFrame = CFrame.new(-255, 11, -49)
wait(0.1)
BALL.CFrame = CFrame.new(-255, 11, -48)
wait(0.1)
BALL.CFrame = CFrame.new(-255, 11, -47)
wait(0.1)
BALL.CFrame = CFrame.new(-255, 11, -49)
wait(0.1)
end
Report Abuse
Hunter4529 is not online. Hunter4529
Joined: 20 Oct 2013
Total Posts: 675
28 Sep 2014 06:04 PM
Use a for loop

http://wiki.roblox.com/index.php?title=Loops#For
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
28 Sep 2014 06:06 PM
ball =script.Parent

while wait(.1) do
ball.CFrame = ball.CFrame +Vector3.new(0,0,1)
end
Report Abuse
Curozilla is not online. Curozilla
Joined: 18 Jun 2014
Total Posts: 2219
28 Sep 2014 06:07 PM
Ah, thanks a lot Master. :D
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
28 Sep 2014 06:08 PM
lol np i had issues like this when i began

did the above work btw?
Report Abuse
Curozilla is not online. Curozilla
Joined: 18 Jun 2014
Total Posts: 2219
28 Sep 2014 06:38 PM
It did. Here's my "WIP" script.

BALL = script.Parent

while wait(0.05) do
BALL.CFrame = BALL.CFrame +Vector3.new(0,0,0.5)
end

repeat wait() until BALL.Position==("-255,11,29")
BALL.CFrame = BALL.CFrame +Vector3.new(0,0,-24)

The last two lines are pretty much not complete.
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
28 Sep 2014 06:39 PM
does that need fixing or are you just showing me?
Report Abuse
Curozilla is not online. Curozilla
Joined: 18 Jun 2014
Total Posts: 2219
28 Sep 2014 06:43 PM
Actually I kinda need help, lol. I want the brick to move to the original position after it reaches a certain position.
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
28 Sep 2014 06:48 PM
ball =script.Parent
orig = ball.CFrame
for i = 1,10 do
wait(.1)
ball.CFrame = ball.CFrame +Vector3.new(0,0,1)
end
ball.CFrame = orig


-- replace 10 with how many times u want it to move up
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