Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ServerScriptService
- local DialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("DialogueEvent")
- local ObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ObjectivEvent")
- local TransitionEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("TransitionEvent")
- local ToggleDialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleDialogueEvent")
- local ToggelObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleObjectiveEvent")
- local function MainGame()
- ToggleDialogueEvent:FireAllClients(true)
- DialogueEvent:FireAllClients("I Need To Find The MainRoom")--What the dialogue says
- wait(4)
- ToggleDialogueEvent:FireAllClients(false)
- ToggelObjectiveEvent:FireAllClients(true)
- ObjectiveEvent:FireAllClients("Find The Main Room")--What the objective is
- end
- wait(2)
- MainGame()
- --DialogueGui
- local RemoteEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleDialogueEvent")
- RemoteEvent.OnClientEvent:Connect(function(Value)
- if Value == true then
- script.Parent.Frame.Visible = true
- else
- script.Parent.Frame.Visible = false
- end
- end)
- --ObjectiveGui
- local RemoteEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleObjectiveEvent")
- RemoteEvent.OnClientEvent:Connect(function(Value)
- if Value == true then
- script.Parent.Frame.Visible = true
- else
- script.Parent.Frame.Visible = false
- end
- end)
- --StarterPlayerScripts
- local Player = game.Players.LocalPlayer
- local RemoteEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ObjectivEvent")
- local Frame = Player.PlayerGui:WaitForChild("ObjectiveGui").Frame
- local function AnimateText(content)
- for i = 1,string.len(content) do
- Frame:WaitForChild("TextLabel").Text = string.sub(content,1,i)
- wait(0.05)
- end
- end
- RemoteEvent.OnClientEvent:Connect(function(content)
- Frame.Visible = true
- Frame:WaitForChild("TextLabel").Text = ""
- AnimateText(content)
- end)
- --StarterCharacterScripts
- local Player = game.Players.LocalPlayer
- local RemoteEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("DialogueEvent")
- local Frame = Player.PlayerGui:WaitForChild("DialogueGui").Frame
- local function AnimateText(content)
- for i = 1,string.len(content) do
- Frame:WaitForChild("TextLabel").Text = string.sub(content,1,i)
- wait(0.05)
- end
- end
- RemoteEvent.OnClientEvent:Connect(function(content)
- Frame.Visible = true
- Frame:WaitForChild("TextLabel").Text = ""
- AnimateText(content)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement