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: Sliding Door

Previous Thread :: Next Thread 
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
17 Jul 2014 04:29 PM
So far I made it so the door opens when you click it, but I need to make it slide open, instead of jumping 7 blocks.

Doors = script.Parent
DoorPiece1 = script.Parent.DoorPiece1
DoorPiece2 = script.Parent.DoorPiece2
ClickDetector = script.Parent.ClickDetector

function move()
DoorPiece1.CFrame = DoorPiece1.CFrame + Vector3.new(0,-7,0)
DoorPiece2.CFrame = DoorPiece2.CFrame + Vector3.new(0,5,0)

end

Doors.ClickDetector.MouseClick:connect(move)

(The script works, I've tested it)
Report Abuse
BlupoV2 is online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
17 Jul 2014 04:40 PM
Use for loops.
Report Abuse
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
17 Jul 2014 05:05 PM
Not exactly sure what you mean, but it doesn't need to loop back to closed. I need to make it slide open, instead of jumping open.
Report Abuse
BlupoV2 is online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
17 Jul 2014 05:11 PM
function move()

for i = 1, 7 do
DoorPiece1.CFrame = DoorPiece1.CFrame - Vector3.new(0, -1, 0)
DoorPiece2.CFrame = DoorPiece2.CFrame - Vector3.new(0, 0.7, 0)
end

end

-- Not sure you can use decimals with Vector3's though.

Report Abuse
BlupoV2 is online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
17 Jul 2014 05:11 PM
Change the -'s to +'s.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
17 Jul 2014 05:12 PM
Yes, you can.
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