Advertisement
HowToRoblox

GameServer

Oct 4th, 2022
4,313
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. game.Players.CharacterAutoLoads = false
  2. game.StarterPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
  3.  
  4.  
  5. game.Players.PlayerAdded:Connect(function(plr)
  6.     plr:LoadCharacter()
  7. end)
  8.  
  9.  
  10. --Start sequence
  11. local ts = game:GetService("TweenService")
  12.  
  13.  
  14. local lift = workspace:WaitForChild("Starting Room"):WaitForChild("Lift")
  15. local liftDoor = workspace:WaitForChild("Starting Room"):WaitForChild("LiftDoor")
  16.  
  17. local liftTI = TweenInfo.new(25, Enum.EasingStyle.Linear)
  18. local liftDoorTI = TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
  19.  
  20.  
  21. local liftCFV = Instance.new("CFrameValue")
  22. liftCFV.Value = lift.PrimaryPart.CFrame
  23. local goalCF = liftCFV.Value - Vector3.new(0, liftCFV.Value.Position.Y - 0.5, 0)
  24.  
  25. liftCFV:GetPropertyChangedSignal("Value"):Connect(function()
  26.    
  27.     lift:SetPrimaryPartCFrame(liftCFV.Value)
  28. end)
  29.  
  30. local liftTween = ts:Create(liftCFV, liftTI, {Value = goalCF})
  31. liftTween:Play()
  32.  
  33. liftTween.Completed:Wait()
  34. task.wait(2)
  35.  
  36.  
  37. local liftDoorCFV = Instance.new("CFrameValue")
  38. liftDoorCFV.Value = liftDoor.PrimaryPart.CFrame
  39. local goalDoorCF = liftDoorCFV.Value + Vector3.new(0, liftDoor:GetExtentsSize().Y, 0)
  40.  
  41. liftDoorCFV:GetPropertyChangedSignal("Value"):Connect(function()
  42.  
  43.     liftDoor:SetPrimaryPartCFrame(liftDoorCFV.Value)
  44. end)
  45.  
  46. local liftDoorTween = ts:Create(liftDoorCFV, liftDoorTI, {Value = goalDoorCF})
  47. liftDoorTween:Play()
  48.  
  49. liftDoorTween.Completed:Wait()
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement