Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.ReplicatedStorage.DoorManage.OnServerEvent:Connect(function(player, door)
- if not door.Cooldown.Value then
- door.Cooldown.Value = true
- if door.Name == "DoubleSlidingDoor" then
- if door.Open.Value and not door.Lockdown.Value then
- door.Interactive.DoorOpen:Play()
- door.Interactive.Granted:Play()
- local info = TweenInfo.new(4)
- local goal = {}
- goal.CFrame = door.Door1.CFrame + door.Door1.CFrame.LookVector * 6
- local tween1 = game:GetService("TweenService"):Create(door.Door1, info, goal)
- local info = TweenInfo.new(4)
- local goal = {}
- goal.CFrame = door.Door2.CFrame + door.Door2.CFrame.LookVector * -6
- local tween2 = game:GetService("TweenService"):Create(door.Door2, info, goal)
- tween1:Play()
- tween2:Play()
- door.Open.Value = false
- tween1.Completed:Connect(function()
- door.Cooldown.Value = false
- end)
- elseif not door.Open.Value and not door.Lockdown.Value then
- door.Interactive.DoorClose:Play()
- door.Interactive.Granted:Play()
- local info = TweenInfo.new(4)
- local goal = {}
- goal.CFrame = door.Door1.CFrame + door.Door1.CFrame.LookVector * -6
- local tween1 = game:GetService("TweenService"):Create(door.Door1, info, goal)
- local info = TweenInfo.new(4)
- local goal = {}
- goal.CFrame = door.Door2.CFrame + door.Door2.CFrame.LookVector * 6
- local tween2 = game:GetService("TweenService"):Create(door.Door2, info, goal)
- tween1:Play()
- tween2:Play()
- door.Open.Value = true
- tween1.Completed:Connect(function()
- door.Cooldown.Value = false
- end)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment