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 can I shorten this script?

Previous Thread :: Next Thread 
TheMesgi is not online. TheMesgi
Joined: 03 Mar 2012
Total Posts: 360
10 Jan 2015 04:29 PM
title

cd = script.Parent
part = script.Parent.Parent
local function onMouseClick(player)
part.CFrame = CFrame.new(147.6, 0, 0)
wait(0.1)
part.CFrame = CFrame.new(147.7, 0, 0)
wait(0.1)
part.CFrame = CFrame.new(147.8, 0, 0)
wait(0.1)
part.CFrame = CFrame.new(147.9, 0, 0)
wait(0.1)
part.CFrame = CFrame.new(148, 0, 0)
wait(0.1)
part.CFrame = CFrame.new(148.1, 0, 0)
wait(0.1)
part.CFrame = CFrame.new(148.2, 0, 0)
wait(0.1)
part.CFrame = CFrame.new(148.3, 0, 0)
wait(0.1)
part.CFrame = CFrame.new(148.4, 0, 0)
wait(0.1)
part.CFrame = CFrame.new(148.5, 0, 0)
wait(0.1)
cd.MouseClick:connect(onMouseClick)
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
10 Jan 2015 04:31 PM
lrn2forloop

http://wiki.roblox.com/index.php?title=For_loop#For
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
10 Jan 2015 04:31 PM
It doesen't even work because of a missing end.

cd = script.Parent
part = script.Parent.Parent
cd.MouseClick:connect(function(plr)
for i = 147.6,148.5,0.1 do
part.CFrame = CFrame.new(i,0,0)
end
end)
Report Abuse
TheMesgi is not online. TheMesgi
Joined: 03 Mar 2012
Total Posts: 360
10 Jan 2015 04:31 PM
Also, it does not work for some reason, can you help with that too? :C
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
10 Jan 2015 04:32 PM
@OP

fedora just fixed le script and made it nice and short
Report Abuse
TheMesgi is not online. TheMesgi
Joined: 03 Mar 2012
Total Posts: 360
10 Jan 2015 04:32 PM
ignore last post thanks
Report Abuse
TheMesgi is not online. TheMesgi
Joined: 03 Mar 2012
Total Posts: 360
10 Jan 2015 04:52 PM
Now ow would I make a script that does that but backwards, like a sliding door that opens when you click and closes when you click again?
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
10 Jan 2015 04:54 PM
cd = script.Parent
part = script.Parent.Parent
cd.MouseClick:connect(function(plr)
for i = 148.5.6,147.6,-0.1 do
part.CFrame = CFrame.new(i,0,0)
end
end)
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