Need help scripting a simple toggle elevator

Hey, so I was wondering if anyone could help write a bit of code for me. I’m trying to make an elevator with a toggle system, but the two main issues I’m having are getting all of the parts in the model to move together as well as the toggle system itself. I have little to no scripting experience, so I’m really struggling to find out what to do for this. I did find a script that I was using as a temporary placeholder, but it lacked a toggle (meaning it would automatically move back up after a few seconds, trapping me) and it only moved one part instead of the entire model.

This model has six elements: Torch, Button, Statue, Base, Part, and Orb. I want to make it so that, when the Button is clicked, the entire model will move downwards a certain number of studs. Once it reaches the end, it will stay where it is until the button is clicked again, and then it will move upwards a certain number of studs. (Obviously by making those the same number, it would return to its starting position.) In terms of how fast it moves, I don’t really care if it’s super slow or not, as long as it moves somewhat fluidly. I don’t really know a lot about physics and movement in Studio, but I know there’s some kind of c-frame trick people have used in the past to make parts move. However, I remember them being pretty janky and basically teleporting to each position, so I definitely don’t want that if possible. I have some giant spinning gears in the game that doesn’t make the player spin with it while standing on it, but the player can still fall between the teeth for whatever reason, meaning that the hotboxes are obviously still updating but the physics aren’t transferring to the character for some reason. Whatever that is, I also wouldn’t want that to happen and have the elevator clip through the player, trapping them, or anything like that. (I’m also trying to fix those gears as a separate project, so if anyone could explain to me why that’s happening, I’d really appreciate it.)

I did create a model for people to use, if you’d like to try to give it a shot yourself. If you’re able to create a working version, please share a link to the model so I can use it, and I’ll credit you in the game! You can find it here: Desert Elevator - Roblox


1 Like

I don’t think anyone is going to write a script for you. If you want to have a go yourself you should look into WeldConstraint | Roblox Creator Documentation and Tween | Roblox Creator Documentation . You might also want to use a ClickDetector | Roblox Creator Documentation for calling the lift.

I did actually make a lift script a long time ago when I was significantly worse at programming, but it might still be useful (although in all honesty it’s more likely to confuse you due to the poor logic).


I can post the file if you want but if you don’t understand the code, it’s not a whole lot more likely that you’ll understand it with the model.

1 Like

I wasn’t necessarily looking for someone to do it FOR me, just some guidance on how to do it myself since I’m pretty clueless. I appreciate that, though, I’ll give it a shot and let you know how it works

This is the file if you wanted it:

1 Like