Advertisement
Nuriden555

Untitled

Jul 14th, 2025
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. -- LocalScript inside StarterGui
  2. local Player = game.Players.LocalPlayer
  3. local ScreenGui = Instance.new("ScreenGui", Player:WaitForChild("PlayerGui"))
  4. local ChatFrame = Instance.new("Frame", ScreenGui)
  5. local ChatBox = Instance.new("TextBox", ChatFrame)
  6.  
  7. -- Setup
  8. ScreenGui.Name = "CustomChat"
  9. ChatFrame.Position = UDim2.new(0.1, 0, 0.8, 0)
  10. ChatFrame.Size = UDim2.new(0.8, 0, 0.1, 0)
  11. ChatFrame.BackgroundColor3 = Color3.fromRGB(30,30,30)
  12. ChatFrame.BorderSizePixel = 0
  13.  
  14. ChatBox.Size = UDim2.new(1, 0, 1, 0)
  15. ChatBox.BackgroundColor3 = Color3.fromRGB(20,20,20)
  16. ChatBox.TextColor3 = Color3.fromRGB(255,255,255)
  17. ChatBox.Font = Enum.Font.Code
  18. ChatBox.TextSize = 18
  19. ChatBox.PlaceholderText = "Type your message..."
  20. ChatBox.ClearTextOnFocus = true
  21.  
  22. ChatBox.FocusLost:Connect(function(enterPressed)
  23.     if enterPressed and ChatBox.Text ~= "" then
  24.         local message = ChatBox.Text
  25.         ChatBox.Text = ""
  26.  
  27.         -- Create on-screen "chat bubble"
  28.         local bubble = Instance.new("TextLabel", ScreenGui)
  29.         bubble.Text = message
  30.         bubble.TextColor3 = Color3.new(1,1,1)
  31.         bubble.Font = Enum.Font.SourceSansBold
  32.         bubble.TextSize = 24
  33.         bubble.Position = UDim2.new(0.5, -100, 0.75, -50)
  34.         bubble.Size = UDim2.new(0, 200, 0, 50)
  35.         bubble.BackgroundTransparency = 1
  36.  
  37.         -- Fade out
  38.         game:GetService("TweenService"):Create(bubble, TweenInfo.new(2), {TextTransparency = 1}):Play()
  39.         wait(2.5)
  40.         bubble:Destroy()
  41.     end
  42. end)
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement