Advertisement
EthanChas

Talky Talky

Aug 9th, 2022 (edited)
648
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.50 KB | None | 0 0
  1. script.Name = "chattext"
  2. local TextService = game:GetService("TextService")
  3. Sound0 = Instance.new("Sound")
  4. Sound0.Name = "talk"
  5. Sound0.Parent = owner.Character.Head
  6. Sound0.MaxDistance = 100
  7. Sound0.SoundId = "rbxassetid://5861332769"
  8. Sound0.Volume = 3
  9. PitchShiftSoundEffect1 = Instance.new("PitchShiftSoundEffect")
  10. PitchShiftSoundEffect1.Parent = Sound0
  11. PitchShiftSoundEffect1.Octave = 0.5
  12. local function typewrite(label, s, secperletter, pitch)
  13.     local newString
  14.  
  15.     for i = 0, s:len(),1 do
  16.         newString = s:sub(1, i)
  17.  
  18.         if s:sub(i - 1, i - 1) == "," then
  19.             wait(0.4)
  20.         elseif s:sub(i- 1, i-1) == "." then
  21.             wait(0.6)
  22.         elseif s:sub(i-1,i-1) == "!" or s:sub(i-1,i-1) == "?" then
  23.             wait(0.6)
  24.         end
  25.  
  26.         label.Text = newString
  27.         owner.Character.Head.talk:Play()
  28.  
  29.         wait(secperletter)
  30.  
  31.     end
  32. end
  33. mas = owner.Character.Head
  34. BillboardGui0 = Instance.new("BillboardGui")
  35. Frame1 = Instance.new("Frame")
  36. TextBox2 = Instance.new("TextBox")
  37. BillboardGui0.Name = "chattext"
  38. BillboardGui0.Parent = mas
  39. BillboardGui0.Size = UDim2.new(6, 0, 2, 0)
  40. BillboardGui0.ResetOnSpawn = false
  41. BillboardGui0.MaxDistance = 100
  42. BillboardGui0.StudsOffsetWorldSpace = Vector3.new(0, 2, 0)
  43. Frame1.Name = "frame"
  44. Frame1.Parent = BillboardGui0
  45. Frame1.Size = UDim2.new(1, 0, 1, 0)
  46. Frame1.BackgroundColor = BrickColor.new("Institutional white")
  47. Frame1.BackgroundColor3 = Color3.new(1, 1, 1)
  48. Frame1.BackgroundTransparency = 1
  49. Frame1.BorderColor = BrickColor.new("Institutional white")
  50. Frame1.BorderColor3 = Color3.new(1, 1, 1)
  51. Frame1.BorderSizePixel = 0
  52. TextBox2.Name = "text"
  53. TextBox2.Parent = Frame1
  54. TextBox2.Size = UDim2.new(1, 0, 1, 0)
  55. TextBox2.BackgroundColor = BrickColor.new("Institutional white")
  56. TextBox2.BackgroundColor3 = Color3.new(1, 1, 1)
  57. TextBox2.BackgroundTransparency = 1
  58. TextBox2.Font = Enum.Font.Oswald
  59. TextBox2.FontSize = Enum.FontSize.Size14
  60. TextBox2.Text = ""
  61. TextBox2.TextColor = BrickColor.new("Really Red")
  62. TextBox2.TextColor3 = Color3.new(1, 0, 0)
  63. TextBox2.TextScaled = false
  64. TextBox2.TextSize = 24
  65. TextBox2.TextStrokeTransparency = 0
  66. TextBox2.TextWrap = true
  67. TextBox2.TextWrapped = true
  68. TextBox2.ClearTextOnFocus = false
  69. TextBox2.TextTransparency = 1
  70. owner.Chatted:Connect(function(msg)
  71.     local FilteredMessage = game:GetService("Chat"):FilterStringForBroadcast(msg,owner)
  72.     game.TweenService:Create(TextBox2,TweenInfo.new(0.25),{TextTransparency=0}):Play()
  73.     typewrite(TextBox2,FilteredMessage,0.05)
  74.     wait(5)
  75.     game.TweenService:Create(TextBox2,TweenInfo.new(0.5),{TextTransparency=1}):Play()
  76. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement