Advertisement
Sungmingamerpro13

DialogueScript (LocalScript)

Nov 21st, 2023
932
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.02 KB | None | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2. local Message = game.ReplicatedStorage:WaitForChild("Message")
  3. local Image = Message:WaitForChild("SpeakerImage")
  4. local Speaker = Message:WaitForChild("SpeakerName")
  5.  
  6. local player = game.Players.LocalPlayer
  7. local DialogueFrame = player.PlayerGui:WaitForChild("DialogueGui").DialogueFrame
  8.  
  9.  
  10. Message:GetPropertyChangedSignal("Value"):Connect(function()
  11.     if Message.Value == "None" then
  12.         DialogueFrame.Message.Visible = false
  13.         DialogueFrame:TweenPosition(UDim2.new(0.55, 0,-1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
  14.     else
  15.         DialogueFrame.Message.Visible = true
  16.         DialogueFrame:TweenPosition(UDim2.new(0.55, 0,0.15, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
  17.     end
  18.     DialogueFrame.Message.Text = Message.Value
  19.     script.Click:Play()
  20. end)
  21.  
  22. Speaker:GetPropertyChangedSignal("Value"):Connect(function()
  23.     print("New Speaker: "..Speaker.Value)
  24.    
  25.     DialogueFrame.ImageLabel.Image = Image.Value
  26.     DialogueFrame.nameLabel.Text = Speaker.Value
  27. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement