Demonlord27

chat

May 6th, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. local cg = Instance.new('ScreenGui', game.CoreGui)
  2. cg.Name = 'CHATGUI'
  3. game.Players.LocalPlayer.Name = 'Guest'
  4. game.Players.LocalPlayer.userId = 261
  5. game.Players.LocalPlayer:SetSuperSafeChat(false)
  6. local cb = Instance.new('TextBox', cg)
  7. cb.Size=UDim2.new(1, 0, 0, 20)
  8. cb.TextXAlignment = 'Left'
  9. cb.BackgroundColor3 = Color3.new(25/255, 25/255, 25/255)
  10. cb.TextColor3 = Color3.new(255, 255, 255)
  11. cb.Font = 'SourceSansLight'
  12. cb.FontSize = 'Size14'
  13. cb.BorderColor3 = Color3.new(255/255, 255/255, 255/255)
  14. cb.Position=UDim2.new(0,0,1,-20)
  15. cb.Text='Click here to chat.'
  16. cb.FocusLost:connect(function(e)
  17. if e then
  18. game.Players:Chat(cb.Text)
  19. cb.Text='Click here or press "R" to chat.'
  20. end
  21. end)
  22. game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(k)
  23. if k == 'r' then
  24. cb:CaptureFocus()
  25. end
  26. end)
  27. local gui = Instance.new("ScreenGui",game.CoreGui)
  28. gui.Name = "OutputGui"
  29. local Outputs = Instance.new("ScrollingFrame",gui)
  30. Outputs.Visible=false
  31. Outputs.BackgroundColor3=Color3.new(0,0,0)
  32. Outputs.BorderColor3=Color3.new(0,0,0)
  33. Outputs.BorderSizePixel=0
  34. Outputs.Position = UDim2.new(.675,0,.725,0)
  35. Outputs.Size=UDim2.new(.3,0,.2,0)
  36. Outputs.CanvasSize=UDim2.new(1.2,0,2,0)
  37. Outputs.ScrollBarThickness=6
  38. Outputs.ScrollingEnabled=true
  39. Outputs.CanvasPosition = Vector2.new(0, 10000)
  40. local Output = function(text)
  41. local color = Color3.new(1,1,1)
  42. local outputList = Outputs:GetChildren()
  43. for i,v in next,Outputs:GetChildren() do
  44. if v:IsA("StringValue") then
  45. table.remove(outputList, i)
  46. else
  47. v.Position = v.Position - UDim2.new(0,0,v.Size.Y.Scale/10,0)
  48. end
  49. end
  50. local NewOutputLine = Instance.new("TextLabel",Outputs)
  51. NewOutputLine.Text = text
  52. NewOutputLine.Size = UDim2.new(1,0,.15,0)
  53. NewOutputLine.Position = UDim2.new(0,0,.985,0)
  54. NewOutputLine.Font = "SourceSansBold"
  55. NewOutputLine.TextColor3 = color
  56. NewOutputLine.TextStrokeTransparency = 0
  57. NewOutputLine.BackgroundTransparency = 1
  58. NewOutputLine.BorderSizePixel = 0
  59. NewOutputLine.FontSize = "Size14"
  60. NewOutputLine.TextXAlignment = "Left"
  61. NewOutputLine.TextYAlignment = "Top"
  62. NewOutputLine.ClipsDescendants = true
  63. NewOutputLine.Name = "OutputLine"
  64. end
  65. local Visible = false
  66. local Open_Close = Instance.new("TextButton",gui)
  67. Open_Close.BackgroundColor3=Color3.new(0,0,0)
  68. Open_Close.BackgroundTransparency=0.5
  69. Open_Close.BorderColor3=Color3.new(0,0,0)
  70. Open_Close.BorderSizePixel=0
  71. Open_Close.Position=UDim2.new(.675,0,.9,0)
  72. Open_Close.Size=UDim2.new(.3,0,.025,0)
  73. Open_Close.Font=Enum.Font.SourceSansBold
  74. Open_Close.FontSize=Enum.FontSize.Size12
  75. Open_Close.Text="Chat Gui - Open"
  76. Open_Close.TextColor3=Color3.new(255,255,255)
  77. Open_Close.TextStrokeColor3=Color3.new(255,255,255)
  78. Open_Close.TextStrokeTransparency=1
  79. Open_Close.MouseButton1Click:connect(function()
  80. if Visible == false then
  81. Outputs.Visible = true
  82. Open_Close.Position = UDim2.new(.675, 0, .7, 0)
  83. Open_Close.Text = "Chat Gui - Close"
  84. Visible = true
  85. else
  86. Outputs.Visible = false
  87. Open_Close.Position = UDim2.new(.675, 0, .9, 0)
  88. Open_Close.Text = "Chat Gui - Open"
  89. Visible = false
  90. end
  91. end)
  92. for _,plr in next,game.Players:GetChildren() do
  93. if not plr:IsA("Player") then return end
  94. plr.Chatted:connect(function(msg)
  95. Output(plr.Name .. ": " .. msg)
  96. end)
  97. end
  98. game.Players.PlayerAdded:connect(function(plr)
  99. plr.Chatted:connect(function(msg)
  100. Output(plr.Name .. ": " .. msg)
  101. end)
  102. end)
Add Comment
Please, Sign In to add comment