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: Anyway to shorten this script?

Previous Thread :: Next Thread 
yhatayhatahoohoo is not online. yhatayhatahoohoo
Joined: 19 Jan 2011
Total Posts: 1988
03 Sep 2016 08:24 PM
Imp = script.Parent
Okm8 = game.Workspace:WaitForChild("Okm8")

Imp.ClickDetector.MouseClick:connect(function()

Okm8:MoveTo(Vector3.new(-1329.9, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1329.8, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1329.7, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1329.6, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1329.5, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1329.4, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1329.3, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1329.2, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1329.1, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1329.0, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1328.9, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1328.8, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1328.6, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1328.5, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1328.4, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1328.3, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1328.2, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1328.1, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1328.0, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1327.9, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1327.8, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1327.6, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1327.5, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1327.4, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1327.3, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1327.2, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1327.1, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1327.0, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1326.9, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1326.8, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1326.6, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1326.5, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1326.4, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1326.3, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1326.2, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1326.1, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1326.0, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1325.9, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1325.8, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1325.6, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1325.5, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1325.4, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1325.3, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1325.2, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1325.1, 0.5, 237))
wait()
Okm8:MoveTo(Vector3.new(-1325.0, 0.5, 237))
wait()
end)
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
03 Sep 2016 08:26 PM
for loop


Report Abuse
xDarkScripter is not online. xDarkScripter
Joined: 31 Jul 2015
Total Posts: 149
03 Sep 2016 08:32 PM
for i=-1329.9,-1325,.1 do
Okm8:MoveTo(Vector3.new(i,.5,237));
wait'';
end;
Report Abuse
VineyardVine is not online. VineyardVine
Joined: 20 Nov 2010
Total Posts: 904
03 Sep 2016 08:35 PM
Or use lerp
http://wiki.roblox.com/index.php?title=Lerp
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
03 Sep 2016 08:35 PM
for 1=1,15 do
if g >= 9 and g <= 0 then
local g = g - 0.1
else
local g = g + 0.1
end
Okm8:MoveTo(Vector3.new((-1325.0 + g), 0.5, 237))
wait(0.05)
end

Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
03 Sep 2016 08:38 PM
not sure why people are over-complicating this but use lerp() or TranslateBy()

Formerly ToxicDominator - add 17,509 posts
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
03 Sep 2016 08:41 PM
i can name a few hundred ways.


$.git('http://Gud',{})
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