Advertisement
MandB

Horror Game

Aug 31st, 2021
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. --ServerScriptService
  2.  
  3. local DialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("DialogueEvent")
  4. local ObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ObjectivEvent")
  5. local TransitionEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("TransitionEvent")
  6.  
  7. local ToggleDialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleDialogueEvent")
  8. local ToggelObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleObjectiveEvent")
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. local function MainGame()
  16. ToggleDialogueEvent:FireAllClients(true)
  17. DialogueEvent:FireAllClients("I Need To Find The MainRoom")--What the dialogue says
  18. wait(4)
  19. ToggleDialogueEvent:FireAllClients(false)
  20. ToggelObjectiveEvent:FireAllClients(true)
  21. ObjectiveEvent:FireAllClients("Find The Main Room")--What the objective is
  22.  
  23.  
  24.  
  25. end
  26.  
  27. wait(2)
  28. MainGame()
  29.  
  30. --DialogueGui
  31.  
  32. local RemoteEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleDialogueEvent")
  33.  
  34. RemoteEvent.OnClientEvent:Connect(function(Value)
  35. if Value == true then
  36. script.Parent.Frame.Visible = true
  37. else
  38. script.Parent.Frame.Visible = false
  39. end
  40. end)
  41.  
  42. --ObjectiveGui
  43.  
  44. local RemoteEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleObjectiveEvent")
  45.  
  46. RemoteEvent.OnClientEvent:Connect(function(Value)
  47. if Value == true then
  48. script.Parent.Frame.Visible = true
  49. else
  50. script.Parent.Frame.Visible = false
  51. end
  52. end)
  53.  
  54. --StarterPlayerScripts
  55.  
  56. local Player = game.Players.LocalPlayer
  57.  
  58. local RemoteEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ObjectivEvent")
  59. local Frame = Player.PlayerGui:WaitForChild("ObjectiveGui").Frame
  60.  
  61. local function AnimateText(content)
  62. for i = 1,string.len(content) do
  63. Frame:WaitForChild("TextLabel").Text = string.sub(content,1,i)
  64. wait(0.05)
  65. end
  66. end
  67.  
  68. RemoteEvent.OnClientEvent:Connect(function(content)
  69. Frame.Visible = true
  70.  
  71. Frame:WaitForChild("TextLabel").Text = ""
  72. AnimateText(content)
  73. end)
  74.  
  75. --StarterCharacterScripts
  76.  
  77. local Player = game.Players.LocalPlayer
  78.  
  79. local RemoteEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("DialogueEvent")
  80. local Frame = Player.PlayerGui:WaitForChild("DialogueGui").Frame
  81.  
  82. local function AnimateText(content)
  83. for i = 1,string.len(content) do
  84. Frame:WaitForChild("TextLabel").Text = string.sub(content,1,i)
  85. wait(0.05)
  86. end
  87. end
  88.  
  89. RemoteEvent.OnClientEvent:Connect(function(content)
  90. Frame.Visible = true
  91.  
  92. Frame:WaitForChild("TextLabel").Text = ""
  93. AnimateText(content)
  94. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement