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: Making a sliding door

Previous Thread :: Next Thread 
ColdplayingDevJonny is not online. ColdplayingDevJonny
Joined: 10 Jan 2016
Total Posts: 4
09 Jul 2016 04:27 PM
Hello commuity!

I came to ask, how can I create a sliding door for my group's base. I basically want it to be a sliding door that slides when you are near it.

I'm not a good scripter, so I came to ask.

1. What is the easiest line of code to use to make it?

2. Will making my own model for the door affect it moving? (Or do I have to use a certain model for the code?)


Report Abuse
BrendonTheWizard is not online. BrendonTheWizard
Joined: 28 Jul 2010
Total Posts: 25709
09 Jul 2016 04:36 PM
It's easiest if you're only moving one part.

You'll want to use a while loop that stores that X, Y, and Z values of the size and position so you can decrement the variable with each iteration and reduce the size to produce a sliding effect.

Try resizing it in studio to see which value (X, Y, or Z) changes when you make it appear to slide and then code it based on which changes

I normally use six variables for this
- The X Position
- The Y Position
- The Z Position
- The X Size
- The Y Size
- The Z Size

Position and size do not change equally so you may want to reduce the position by less than how much you reduce the size to get a nice animation.

If you're using multiple such as a model, I recommend setting a PrimaryPart and CFrame it from the PrimaryPart's position and find a way to not mess with size at all.
Report Abuse
frommage is not online. frommage
Joined: 22 Apr 2014
Total Posts: 100
09 Jul 2016 05:06 PM
My suggestion is that you take a free model of a sliding door that works, test to make sure it works, then move the scripts to the same positions in explorer for the door you want to work (If it (the script) is in a model, model your new door and put the script in the model.)

You'll need to name each part to correspond with the script


If not, PM me your design model and I'll make it WORK :D
Report Abuse
fret13103 is not online. fret13103
Joined: 15 Mar 2010
Total Posts: 881
09 Jul 2016 05:17 PM
its really easy

loop through players

make a vector using the difference in positions between the door's central part and the current players position

if the magnitude of that vector is less than lets say 10 studs then use a for loop to keep moving the sliding part of the door

Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
09 Jul 2016 05:17 PM
@Brendon It's also easy with models because all you have to move is the main part if you set one.


#code function brag() print("R$1,086") end
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
09 Jul 2016 05:35 PM
use hydraulics


beep beep +1 post woohoo
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