Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local door1 = script.Parent:WaitForChild("Door1")
- local tweeningInformation = TweenInfo.new(
- 0.5,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local door1Open = {CFrame = CFrame.new(-4.23, 3.99, -8.56)}
- local door1Close = {CFrame = CFrame.new(-11.57, 3.99, -8.56)}
- local tween1open = TweenService:Create(door1,tweeningInformation,door1Open)
- local tween1close = TweenService:Create(door1,tweeningInformation,door1Close)
- script.Parent.Detector1.Touched:Connect(function(hit)
- tween1open:Play()
- wait(2)
- tween1close:Play()
- end)
- script.Parent.Detector2.Touched:Connect(function(hit)
- tween1open:Play()
- wait(2)
- tween1close:Play()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement