Advertisement
MandB

ServerScriptService

Sep 17th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1.  
  2. local DialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("DialogueEvent")
  3. local ObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ObjectivEvent")
  4. local TransitionEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("TransitionEvent")
  5.  
  6. local ToggleDialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleDialogueEvent")
  7. local ToggelObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleObjectiveEvent")
  8.  
  9. local IntroEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("IntroEvent")
  10.  
  11. local function Teleport(Position)
  12. local Players = game.Players:GetPlayers()
  13.  
  14. for i, player in pairs(Players) do
  15. if player.Character then
  16. player.Character.Humanoid.Jump = true
  17. player.Character:SetPrimaryPartCFrame(Position)
  18. end
  19. end
  20. end
  21.  
  22.  
  23.  
  24. local function MainGame()
  25. ToggleDialogueEvent:FireAllClients(true)
  26. DialogueEvent:FireAllClients("I Need To Find The MainRoom")--What the dialogue says
  27. wait(4)
  28. ToggleDialogueEvent:FireAllClients(false)
  29. ToggelObjectiveEvent:FireAllClients(true)
  30. ObjectiveEvent:FireAllClients("Find The Main Room")--What the objective is
  31.  
  32. repeat wait() until game.Workspace.Triggers.DialogueTriggers:FindFirstChild("FoundOfficeTrigger") == nil
  33.  
  34. ToggleDialogueEvent:FireAllClients(true)
  35. ToggelObjectiveEvent:FireAllClients(false)
  36. DialogueEvent:FireAllClients("Darn I Need A key Better Keep Looking Around")
  37. wait(4)
  38. ToggleDialogueEvent:FireAllClients(false)
  39. ToggelObjectiveEvent:FireAllClients(true)
  40. ObjectiveEvent:FireAllClients("Find The Key")
  41.  
  42. repeat wait() until game.Workspace.Triggers.DialogueTriggers:FindFirstChild("FoundGymTrigger") == nil
  43.  
  44. ToggleDialogueEvent:FireAllClients(true)
  45. ToggelObjectiveEvent:FireAllClients(false)
  46. DialogueEvent:FireAllClients("I Need To Unlock The SpareRoom To Get The Maze")
  47. wait(4)
  48. ToggleDialogueEvent:FireAllClients(false)
  49. ToggelObjectiveEvent:FireAllClients(true)
  50. ObjectiveEvent:FireAllClients("Unlock The SpareRoom")
  51.  
  52.  
  53.  
  54.  
  55.  
  56. repeat wait() until game.Workspace.Triggers.DialogueTriggers:FindFirstChild("GymTrigger") == nil
  57.  
  58. TransitionEvent:FireAllClients()
  59. wait(2)
  60. Teleport(game.Workspace.TeleportPoints.MazeTeleport.CFrame)
  61.  
  62.  
  63.  
  64.  
  65. repeat wait() until game.Workspace.Triggers.DialogueTriggers:FindFirstChild("MazeDoorTrigger") == nil
  66.  
  67. TransitionEvent:FireAllClients()
  68. wait(2)
  69. Teleport(game.Workspace.TeleportPoints.MazeExitTeleport.CFrame)
  70.  
  71.  
  72. end
  73.  
  74. wait(2)
  75. MainGame()
  76.  
  77. game.Players.PlayerAdded:Connect(function(Player)
  78. IntroEvent:FireClient(Player)
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement