Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create the ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "ChatGui"
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- -- Create the Background Frame
- local background = Instance.new("Frame")
- background.Size = UDim2.new(0, 350, 0, 220)
- background.Position = UDim2.new(0.5, -175, 0.5, -110)
- background.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- background.BorderSizePixel = 0
- background.Parent = screenGui
- -- Make the ScreenGui draggable
- local dragging, dragInput, dragStart, startPos
- local function update(input)
- local delta = input.Position - dragStart
- background.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- background.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = background.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- background.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- game:GetService("UserInputService").InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- -- Create the TextBox
- local textBox = Instance.new("TextBox")
- textBox.Size = UDim2.new(0, 300, 0, 40)
- textBox.Position = UDim2.new(0.5, -150, 0.5, -60)
- textBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- textBox.BorderSizePixel = 0
- textBox.PlaceholderText = "message here"
- textBox.Parent = background
- -- Animation for TextBox
- textBox.MouseEnter:Connect(function()
- textBox:TweenSize(UDim2.new(0, 310, 0, 45), "Out", "Quad", 0.2, true)
- end)
- textBox.MouseLeave:Connect(function()
- textBox:TweenSize(UDim2.new(0, 300, 0, 40), "Out", "Quad", 0.2, true)
- end)
- -- Create the Send Button
- local sendButton = Instance.new("TextButton")
- sendButton.Size = UDim2.new(0, 140, 0, 40)
- sendButton.Position = UDim2.new(0.5, -150, 0.5, 10)
- sendButton.Text = "Send"
- sendButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
- sendButton.BorderSizePixel = 0
- sendButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- sendButton.Parent = background
- -- Animation for Send Button
- sendButton.MouseEnter:Connect(function()
- sendButton:TweenSize(UDim2.new(0, 145, 0, 45), "Out", "Quad", 0.2, true)
- end)
- sendButton.MouseLeave:Connect(function()
- sendButton:TweenSize(UDim2.new(0, 140, 0, 40), "Out", "Quad", 0.2, true)
- end)
- -- Create the Clear Button
- local clearButton = Instance.new("TextButton")
- clearButton.Size = UDim2.new(0, 140, 0, 40)
- clearButton.Position = UDim2.new(0.5, 10, 0.5, 10)
- clearButton.Text = "Clear"
- clearButton.BackgroundColor3 = Color3.fromRGB(255, 85, 85)
- clearButton.BorderSizePixel = 0
- clearButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- clearButton.Parent = background
- -- Animation for Clear Button
- clearButton.MouseEnter:Connect(function()
- clearButton:TweenSize(UDim2.new(0, 145, 0, 45), "Out", "Quad", 0.2, true)
- end)
- clearButton.MouseLeave:Connect(function()
- clearButton:TweenSize(UDim2.new(0, 140, 0, 40), "Out", "Quad", 0.2, true)
- end)
- -- Create the "Made by ONLYSCRIPTS" Label
- local madeByLabel = Instance.new("TextLabel")
- madeByLabel.Size = UDim2.new(0, 300, 0, 20)
- madeByLabel.Position = UDim2.new(0.5, -150, 0.5, 55)
- madeByLabel.Text = "Made by ONLYSCRIPTS"
- madeByLabel.BackgroundTransparency = 1
- madeByLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- madeByLabel.TextScaled = true
- madeByLabel.Parent = background
- -- Bypass stuff
- sendButton.MouseButton1Click:Connect(function()
- local TextChatService = game:GetService("TextChatService")
- local msg = textBox.text
- local channel = game.TextChatService:WaitForChild("TextChannels"):WaitForChild("RBXGeneral")
- channel:SendAsync(" " .. msg )
- end)
- -- Connect the Clear Button to clear the TextBox
- clearButton.MouseButton1Click:Connect(function()
- textBox.Text = ""
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement