#Door - System

1 messages · Page 1 of 1 (latest)

white houndBOT
#
Support Thread

Hey there! It looks like you have created a thread in our support forums.
This message is to provide some information on how to use this thread.

Please do not ping staff members directly, they will respond to your thread when they are available.

If you are experiencing issues with a product or service, please provide as much information as possible.
This includes any error messages, steps to reproduce the issue, and any other relevant information.

Please remember that we are all volunteers, and everything we do is in our free time.
We pride ourselves on providing the best support possible, but after all its all for free so please be patient and understanding.

None of this was meant to scare you away, we are happy to help and will do our best to resolve your issue.
Thank you for understanding and we hope we can help!

uneven lintel
#

``local TweenService = game:GetService("TweenService")

local DoorL = script.Parent:FindFirstChild("DoorL")
local DoorR = script.Parent:FindFirstChild("DoorR")
local scanPart1 = script.Parent:FindFirstChild("ScanPart1")
local scanPart2 = script.Parent:FindFirstChild("ScanPart2")

if not DoorL or not DoorR or not scanPart1 or not scanPart2 then
warn("One or more parts are missing from the script's parent.")
return
end

local moveDistance = 3.5
local moveTime = 2.5
local cooldownTime = 1
local waitBeforeClosing = 5
local canOpen = true
local isMoving = false
local isOpen = false

local function moveDoor(door, direction)
local originalCFrame = door.CFrame
local targetCFrame = originalCFrame * CFrame.new(direction * moveDistance)

local tweenInfo = TweenInfo.new(moveTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local goal = {CFrame = targetCFrame}
local tween = TweenService:Create(door, tweenInfo, goal)

return tween

end

local function onTouch(other)
print("Touched by: " .. other.Name)
local character = other.Parent
local humanoid = character:FindFirstChildOfClass("Humanoid")

if humanoid and isOpen then
    return
end

``