I am trying to make a lift. It isn’t exactly the most conventional lift but it will do for my purpose.
Process
These are my inputs. The Medium Stone Buttons contain a Sliding Script.
Sliding Script
open = false
door6 = script.Parent.Parent.Parent.Door6
local TweenService = game:GetService(“TweenService”)
local part = script.Parent
local tweenInfo = TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local Door8Open = {CFrame = door6.CFrame + door6.CFrame.lookVector * 24.5}
local Door8Close = {CFrame = door6.CFrame }
local Open6 = TweenService:Create(door6,tweenInfo,Door8Open)
local Close6 = TweenService:Create(door6,tweenInfo,Door8Close)
script.Parent.MouseClick:connect(function()
if open == false then
Open6:Play()
wait(2)
open = true
else
Close6:Play()
wait(2)
open = false
end
end)
The Bright Red Button contains a script that when active, the selected part becomes transparent and CanCollide is turned off. I’ll just call it the “Button Script” for simplicity.
The Button Script
open=true
script.Parent.mouseClick:connect(function()
if open== true then
open=false
script.Parent.Parent.Parent.Door8.Transparency=1
script.Parent.Parent.Parent.Door8.CanCollide=false
script.Parent.Parent.Parent.Door6.Transparency=0
script.Parent.Parent.Parent.Door6.CanCollide=true
script.Parent.Parent.BrickColor=script.ButtonO.Value
else
open=true
script.Parent.Parent.Parent.Door8.Transparency=0
script.Parent.Parent.Parent.Door8.CanCollide=true
script.Parent.Parent.Parent.Door6.Transparency=1
script.Parent.Parent.Parent.Door6.CanCollide=false
end
end)
Dilemma
What is meant to happen is that I will first press the Bright Red Button, which makes the part above me disappear. I named that part “Door8” as it is a simple Parent name. I will then use the Sliding Script to “slide” the part below me, which I will call “Door6”, up. That works fine. There’s also inputs at the top which reverses the process so I can descend. The process for descending is slightly more complicated as I need to press the Bright Red Button at the top to make Door6 disappear (and to turn off its CanCollide properties) and to make Door8 re-appear (with its original properties). That also works fine and I can descend.
The problem occurs when I try to ascend again. I need Door6 to descent with Door8 so I can make it re-appear underneath me.
If you couldn’t tell, I am not a Scripter as I am mainly a Builder. So help would be appreciated.