Issues with making a lift

So I’ve been trying to make a multi-floor elevator. It seemed to work fine after a lot of scripting, so I built a shell and elevator shaft.

I go to test it and…
It’s broken.

I probably overlooked this, and has nothing to do with the model.
The issue is: if you want to go to the second floor from floor 1, it works like it should, but if you go from floor 2 to floor 1 then it errors.

I tried making floor 3 and 0 to see if it changed anything, and yes, but that still doesn’t solve the issue. The lift just goes to level 0 and then back to 1

I have no idea how to fix this, and I’ve been trying for a while now.

EDIT: Updated file, also unions seem to be corrupted, but that’s fine
EDIT 2: Removed downloadable file

I don’t think you should send the file but I’m not too sure but here is my guess;

Make sure it’s not anchored and rathered welded. If it did work before, that is my guess.

The elevator moves fine, it just goes to the wrong floor

Perhaps the script isn’t checking if it is at that floor (position) and stopping?

Also, is there any advantage to using tweens instead of body movers to move the elevator? I feel like body movers would make the code less complex.

1 Like

BrokenLift.rbxm (133.3 KB)

Think I might’ve fixed the problem

1 Like

I managed to fix the issue myself. I’m not even sure what I exactly did lol

I just added some if statements to see if the lift goes up or down, changed some things around, and now it seems to work perfectly.