Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SetImageDialogueEvent = game.ReplicatedStorage.DialogueGuiEvent.SetImageDialogueEvent
- local DialogueEvent = game.ReplicatedStorage.DialogueGuiEvent.CreateDialogueEvent
- local HideDialogueEvent = game.ReplicatedStorage.DialogueGuiEvent.HideDialogueEvent
- local player = game.Players.LocalPlayer
- local DialogueFrame = player.PlayerGui:WaitForChild("DialogueGui").DialogueFrame
- local function AnimateText(Dialog)
- for i = 1, #Dialog, 1 do
- DialogueFrame.DialogueFrame.Message.Text = string.sub(Dialog, 1, i)
- script.DialogueSound:Play()
- wait(0.04)
- end
- end
- HideDialogueEvent.OnClientEvent:Connect(function()
- DialogueFrame:TweenPosition(UDim2.new(0.55, 0,-1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
- end)
- DialogueEvent.OnClientEvent:Connect(function(Dialogue)
- DialogueFrame:TweenPosition(UDim2.new(0.55, 0,0.15, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
- AnimateText(Dialogue)
- end)
- SetImageDialogueEvent.OnClientEvent:Connect(function(PlayerName, PlayerImage)
- DialogueFrame.PlayerFrame.PlayerFrame:WaitForChild("PlayerImage").Image = PlayerImage
- DialogueFrame.PlayerFrame.PlayerFrame.PlayerImage:WaitForChild("nameLabel").Text = PlayerName
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement