A door takes too long to open. Im using CFrame here is the script:
function onClicked() if script.Parent.Value.Value == true then script.Parent.Value.Value = false if script.Parent.V.Value == true then script.Parent.V.Value = false wait(0) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) wait(0.01) elseif script.Parent.V.Value == false then script.Parent.V.Value = true script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0.05, 0, -0.36) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.285) * CFrame.fromEulerAnglesXYZ(0, 0, 0) wait(0.01) end script.Parent.Value.Value = true end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
I would use tweening for the doors, you can get a tutorial from alvin bloxs here.
FYI does not have to be sliding, just adjust it. https://www.youtube.com/watch?v=ya4GzyZdLMA
To do this, tweening should be used.
An example is as follows:
local TweenService = game:GetService("TweenService") -- Get the tween service, we need this to make a tween local Goal = {} -- Make a blank dictionary this will be used to indicate where we want the part to be. Goal.CFrame = CFrame.new(X, Y, Z) -- Say where we want the part to end up local Tween = TweenService:Create(Door, TweenInfo.new(), Goal) -- Create a new tween using the Object we want to move (in this case the door), some tween info (we will use defualt with TweenInfo.new()) and the Goal we want the part to reach Tween:Play() -- Play the tween the part will be moved to the goal over the course of 1 second.
Please refer to the Roblox Developer Hub for more information: https://www.robloxdev.com/api-reference/class/TweenService