Advertisement
HenloMyDude

custom chat UI

Dec 31st, 2019
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1.  
  2. plr = owner
  3. plrgui = plr.PlayerGui
  4.  
  5. local gui = Instance.new("ScreenGui", plrgui)
  6. gui.Name = "chat"
  7. local scroll = Instance.new("ScrollingFrame", gui)
  8. scroll.Size = UDim2.new(0, 350, 0, 550)
  9. scroll.AnchorPoint = Vector2.new(1, 1)
  10. scroll.Position = UDim2.new(1, 0, 1, 0)
  11. scroll.BorderSizePixel = 2
  12. scroll.BackgroundTransparency = 0.15
  13. scroll.BorderColor3 = Color3.new(1, 1, 1)
  14. scroll.BackgroundColor3 = BrickColor.new("Bright blue").Color
  15.  
  16. local last = nil
  17.  
  18. function message2(texto)
  19. for i,v in pairs (scroll:children()) do
  20. if v:IsA("TextLabel") then
  21. v.AnchorPoint = v.AnchorPoint - Vector2.new(0, 0.025)
  22. v.Position = v.Position - UDim2.new(0, 0, 0.025, 0)
  23. end
  24. end
  25. local text = Instance.new("TextLabel", scroll)
  26. text.Size = UDim2.new(0, 275, 0, 50)
  27. text.BackgroundTransparency = 1
  28. text.TextColor3 = Color3.new(1, 1, 1)
  29. text.TextScaled = true
  30. if last == nil then
  31. text.AnchorPoint = Vector2.new(0, 0.075)
  32. text.Position = UDim2.new(0, 0, 0.075, 0)
  33. else
  34. text.AnchorPoint = Vector2.new(0, text.AnchorPoint.y + 0.025)
  35. text.Position = last.Position + UDim2.new(0, 0, 0.025, 0)
  36. end
  37. text.Text = texto
  38. end
  39.  
  40. message2("scroll down for the actual chat")
  41.  
  42. function message(texto)
  43. for i,v in pairs (scroll:children()) do
  44. if v:IsA("TextLabel") then
  45. v.AnchorPoint = v.AnchorPoint - Vector2.new(0, 0.025)
  46. v.Position = v.Position - UDim2.new(0, 0, 0.025, 0)
  47. end
  48. end
  49. local text = Instance.new("TextLabel", scroll)
  50. text.Size = UDim2.new(0, 275, 0, 50)
  51. text.BackgroundTransparency = 1
  52. text.TextColor3 = Color3.new(1, 1, 1)
  53. text.TextScaled = true
  54. if last == nil then
  55. text.AnchorPoint = Vector2.new(0, 0.45)
  56. text.Position = UDim2.new(0, 0, 0.45, 0)
  57. else
  58. text.AnchorPoint = Vector2.new(0, text.AnchorPoint.y + 0.025)
  59. text.Position = last.Position + UDim2.new(0, 0, 0.025, 0)
  60. end
  61. text.Text = texto
  62. if texto:sub(1, 7) == "/invert" then
  63. text.Text = texto:sub(9)
  64. text.Rotation = 180
  65. end
  66. last = text
  67. end
  68.  
  69. function getplayermessages()
  70. for i,v in pairs (game:GetService("Players"):children()) do
  71. if v:IsA("Player") then
  72. v.Chatted:connect(function(msg)
  73. message(v.Name ..": " ..msg)
  74. end)
  75. end
  76. end
  77. game:GetService("Players").PlayerAdded:connect(function(p)
  78. message(p.Name .." joined!")
  79. p.Chatted:connect(function(msg)
  80. message(p.Name ..": " ..msg)
  81. end)
  82. end)
  83. game:GetService("Players").PlayerRemoving:connect(function(p)
  84. message(p.Name .." left! D:")
  85. end)
  86. end
  87.  
  88. getplayermessages()
  89. message("this is my custom chat. enjoy i guess (by youngmacka123)")
  90. --by youngmacka123
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement