-- // Steven_Scripts, 2022


local tws = game:GetService("TweenService")

local buttonSystem = script.Parent
local alarmPart = buttonSystem.AlarmPart
local gate = buttonSystem.Parent
local door = gate.SlidingMetalDoor

local reader = buttonSystem.KeycardReader
local readerPrimary = reader.PrimaryPart

local prompt = readerPrimary.ProximityPrompt

local doorPrimary = gate.SlidingMetalDoor.Primary

local closedPos = door.ClosePos
local openPos = door.OpenPos

local doorCloseTween = tws:Create(doorPrimary,TweenInfo.new(8, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut),{CFrame = closedPos.CFrame})
local doorOpenTween = tws:Create(doorPrimary,TweenInfo.new(8, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut),{CFrame = openPos.CFrame})