Advertisement
fgdgdgfgdfgfg

Untitled

Jan 22nd, 2025
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. local screenGui = Instance.new("ScreenGui")
  2. local frame = Instance.new("Frame")
  3. local textLabel = Instance.new("TextLabel")
  4. local textBox = Instance.new("TextBox")
  5. local sendButton = Instance.new("TextButton")
  6.  
  7. -- Set up the ScreenGui
  8. screenGui.Name = "MessageGUI"
  9. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  10.  
  11. -- Set up the Frame
  12. frame.Size = UDim2.new(0.4, 0, 0.3, 0)
  13. frame.Position = UDim2.new(0.3, 0, 0.35, 0)
  14. frame.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
  15. frame.Parent = screenGui
  16.  
  17. -- Set up the TextLabel
  18. textLabel.Text = "Enter your message:"
  19. textLabel.Size = UDim2.new(1, 0, 0.3, 0)
  20. textLabel.Position = UDim2.new(0, 0, 0, 0)
  21. textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  22. textLabel.TextColor3 = Color3.new(1, 1, 1)
  23. textLabel.TextScaled = true
  24. textLabel.Parent = frame
  25.  
  26. -- Set up the TextBox
  27. textBox.PlaceholderText = "Type here..."
  28. textBox.Size = UDim2.new(0.9, 0, 0.3, 0)
  29. textBox.Position = UDim2.new(0.05, 0, 0.35, 0)
  30. textBox.BackgroundColor3 = Color3.new(1, 1, 1)
  31. textBox.TextColor3 = Color3.new(0, 0, 0)
  32. textBox.TextScaled = true
  33. textBox.Parent = frame
  34.  
  35. -- Set up the TextButton
  36. sendButton.Text = "Send Message"
  37. sendButton.Size = UDim2.new(0.6, 0, 0.2, 0)
  38. sendButton.Position = UDim2.new(0.2, 0, 0.7, 0)
  39. sendButton.BackgroundColor3 = Color3.new(0.1, 0.6, 0.1)
  40. sendButton.TextColor3 = Color3.new(1, 1, 1)
  41. sendButton.TextScaled = true
  42. sendButton.Parent = frame
  43.  
  44. -- Button click function
  45. sendButton.MouseButton1Click:connect(function()
  46. local messageText = textBox.Text
  47. if messageText and messageText ~= "" then
  48. local message = Instance.new("Message")
  49. message.Text = messageText
  50. message.Parent = workspace
  51. wait(5)
  52. message:Destroy()
  53. end
  54. end)
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement