Advertisement
Sungmingamerpro13

DialogueScript (SungExetior13RBLX Style)

Jul 12th, 2024
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.18 KB | None | 0 0
  1. local SetImageDialogueEvent = game.ReplicatedStorage.DialogueGuiEvent.SetImageDialogueEvent
  2. local DialogueEvent = game.ReplicatedStorage.DialogueGuiEvent.CreateDialogueEvent
  3. local HideDialogueEvent = game.ReplicatedStorage.DialogueGuiEvent.HideDialogueEvent
  4.  
  5. local player = game.Players.LocalPlayer
  6. local DialogueFrame = player.PlayerGui:WaitForChild("DialogueGui").DialogueFrame
  7.  
  8. local function AnimateText(Dialog)
  9.     for i = 1, #Dialog, 1 do
  10.         DialogueFrame.DialogueFrame.Message.Text = string.sub(Dialog, 1, i)
  11.         script.DialogueSound:Play()
  12.         wait(0.04)
  13.     end
  14. end
  15.  
  16. HideDialogueEvent.OnClientEvent:Connect(function()
  17.     DialogueFrame:TweenPosition(UDim2.new(0.55, 0,-1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
  18. end)
  19.  
  20. DialogueEvent.OnClientEvent:Connect(function(Dialogue)
  21.     DialogueFrame:TweenPosition(UDim2.new(0.55, 0,0.15, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
  22.     AnimateText(Dialogue)
  23. end)
  24.  
  25. SetImageDialogueEvent.OnClientEvent:Connect(function(PlayerName, PlayerImage)
  26.     DialogueFrame.PlayerFrame.PlayerFrame:WaitForChild("PlayerImage").Image = PlayerImage
  27.     DialogueFrame.PlayerFrame.PlayerFrame.PlayerImage:WaitForChild("nameLabel").Text = PlayerName
  28. end)
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement