Advertisement
Pancakess

idkr

Mar 17th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. players = game:GetService("Players")
  2. player = players.Trip3mario
  3. head = player.Character:WaitForChild("Head")
  4. max_distance = 60
  5. chat_bubbles = 0
  6. gui_height = 5
  7. bubble_color = Color3.new(0,0,0)
  8. chat_color = Color3.new(210, 0, 0)
  9.  
  10. function createChatBubble(seconds, message)
  11. chat_bubbles = chat_bubbles + 1
  12. local gui = Instance.new("BillboardGui",head)
  13. gui.Adornee = head
  14. gui.MaxDistance = max_distance
  15. gui.ExtentsOffsetWorldSpace = Vector3.new(0,gui_height+(chat_bubbles*1.5),0)
  16. gui.Size = UDim2.new(0,32*(#message/3),0.6,0)
  17.  
  18. local chat_bubble = Instance.new("Frame",gui)
  19. chat_bubble.Size = UDim2.new(1,0,1,0)
  20. chat_bubble.BackgroundTransparency = 0.5
  21. chat_bubble.BackgroundColor3 = bubble_color
  22.  
  23.  
  24. local text_label = Instance.new("TextBox",chat_bubble)
  25. text_label.Text = message
  26. text_label.Size = UDim2.new(1,0,1,0)
  27. text_label.TextColor3 = chat_color
  28. text_label.TextSize = 20
  29. text_label.Font = "Arcade"
  30. text_label.BackgroundTransparency = 1
  31.  
  32. wait(seconds)
  33. gui:Destroy()
  34. chat_bubbles = chat_bubbles - 1
  35. end
  36.  
  37. player.chatted:connect(function(msg)
  38. chat = coroutine.wrap(createChatBubble)
  39. chat((#msg/5)+2,msg)
  40. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement