Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local Door = script.Parent:WaitForChild("SlidingDoor")
- local tweeningInfo = TweenInfo.new(
- 0.9,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local doorOpen = {CFrame = CFrame.new(10.5, -4, 7.5)}
- local doorClose = {CFrame = CFrame.new(10.5, 4.2, 7.5)}
- local tweenOpen = TweenService:Create(Door,tweeningInfo,doorOpen)
- local tweenClose = TweenService:Create(Door,tweeningInfo,doorClose)
- script.Parent.Detector1.Touched:Connect(function(hit)
- tweenOpen:Play()
- wait(3)
- tweenClose:Play()
- end)
Add Comment
Please, Sign In to add comment