Advertisement
Primal_Dev

Dialogue Script

May 5th, 2022
572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2.  
  3. local DialogueEvent = game.ReplicatedStorage.RemoteEvents.GuiEvents.DialogueEvent
  4. local Frame = player.PlayerGui:WaitForChild("DialogueGui").Frame
  5.  
  6. local function AnimateText(Dialogue)
  7.     for i = 1, #Dialogue, 1 do
  8.         Frame:WaitForChild("DialogueLabel").Text = string.sub(Dialogue, 1, i)
  9.         wait(0.04)
  10.     end
  11. end
  12.  
  13. DialogueEvent.OnClientEvent:Connect(function(PlayerImage, PlayerName, Dialogue)
  14.     Frame.Visible = true
  15.     Frame:WaitForChild("NameLabel").Text = PlayerName
  16.     Frame:WaitForChild("ImageLabel").Image = PlayerImage
  17.     AnimateText(Dialogue)
  18. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement