Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Pastebin.com Uploader
- Req: Your Pastebin.com API key - https://pastebin.com/doc_api
- (You need to have a pastebin.com account to have an api key)
- Developed by @jogs0110 on discord
- kiro0001.github.io - input only the page (ex: /Fjnfj7hm , Fjnfj7hm)
- ]]
- local PASTEBIN_API_URL = "https://pastebin.com/api/api_post.php"
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "PastebinUploader"
- ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local MainFrame = Instance.new("Frame")
- MainFrame.Size = UDim2.new(0, 350, 0, 400)
- MainFrame.Position = UDim2.new(0.5, -175, 0.5, -200)
- MainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
- MainFrame.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
- MainFrame.BorderSizePixel = 0
- MainFrame.Parent = ScreenGui
- local Corner = Instance.new("UICorner")
- Corner.CornerRadius = UDim.new(0, 8)
- Corner.Parent = MainFrame
- local TitleBar = Instance.new("Frame")
- TitleBar.Size = UDim2.new(1, 0, 0, 40)
- TitleBar.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- TitleBar.BorderSizePixel = 0
- TitleBar.Parent = MainFrame
- local CornerTitle = Instance.new("UICorner")
- CornerTitle.CornerRadius = UDim.new(0, 8)
- CornerTitle.Parent = TitleBar
- local Title = Instance.new("TextLabel")
- Title.Size = UDim2.new(1, -40, 1, 0)
- Title.BackgroundTransparency = 1
- Title.Text = "Pastebin Uploader"
- Title.TextColor3 = Color3.new(1, 1, 1)
- Title.Font = Enum.Font.SourceSansBold
- Title.TextSize = 24
- Title.Parent = TitleBar
- local CloseButton = Instance.new("TextButton")
- CloseButton.Size = UDim2.new(0, 30, 0, 30)
- CloseButton.Position = UDim2.new(1, -35, 0.5, -15)
- CloseButton.AnchorPoint = Vector2.new(1, 0.5)
- CloseButton.BackgroundColor3 = Color3.fromRGB(200, 60, 60)
- CloseButton.Text = "X"
- CloseButton.TextColor3 = Color3.new(1, 1, 1)
- CloseButton.Font = Enum.Font.SourceSansBold
- CloseButton.TextSize = 18
- CloseButton.Parent = TitleBar
- local CloseCorner = Instance.new("UICorner")
- CloseCorner.CornerRadius = UDim.new(0, 6)
- CloseCorner.Parent = CloseButton
- local ApiKeyFrame = Instance.new("Frame")
- ApiKeyFrame.Size = UDim2.new(0.9, 0, 0, 70)
- ApiKeyFrame.Position = UDim2.new(0.05, 0, 0.12, 0)
- ApiKeyFrame.BackgroundTransparency = 1
- ApiKeyFrame.Parent = MainFrame
- local ApiKeyLabel = Instance.new("TextLabel")
- ApiKeyLabel.Size = UDim2.new(1, 0, 0, 20)
- ApiKeyLabel.Text = "API Key:"
- ApiKeyLabel.TextColor3 = Color3.new(1, 1, 1)
- ApiKeyLabel.Font = Enum.Font.SourceSans
- ApiKeyLabel.TextSize = 18
- ApiKeyLabel.TextXAlignment = Enum.TextXAlignment.Left
- ApiKeyLabel.BackgroundTransparency = 1
- ApiKeyLabel.Parent = ApiKeyFrame
- local ApiKeyBox = Instance.new("TextBox")
- ApiKeyBox.Size = UDim2.new(1, 0, 0, 40)
- ApiKeyBox.Position = UDim2.new(0, 0, 0, 25)
- ApiKeyBox.BackgroundColor3 = Color3.fromRGB(65, 65, 65)
- ApiKeyBox.Text = ""
- ApiKeyBox.PlaceholderText = "Paste your Pastebin API key here"
- ApiKeyBox.TextColor3 = Color3.new(1, 1, 1)
- ApiKeyBox.Font = Enum.Font.SourceSans
- ApiKeyBox.TextSize = 16
- ApiKeyBox.Parent = ApiKeyFrame
- local ApiKeyCorner = Instance.new("UICorner")
- ApiKeyCorner.CornerRadius = UDim.new(0, 6)
- ApiKeyCorner.Parent = ApiKeyBox
- local TitleFrame = Instance.new("Frame")
- TitleFrame.Size = UDim2.new(0.9, 0, 0, 70)
- TitleFrame.Position = UDim2.new(0.05, 0, 0.32, 0)
- TitleFrame.BackgroundTransparency = 1
- TitleFrame.Parent = MainFrame
- local TitleLabel = Instance.new("TextLabel")
- TitleLabel.Size = UDim2.new(1, 0, 0, 20)
- TitleLabel.Text = "Paste Title:"
- TitleLabel.TextColor3 = Color3.new(1, 1, 1)
- TitleLabel.Font = Enum.Font.SourceSans
- TitleLabel.TextSize = 18
- TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
- TitleLabel.BackgroundTransparency = 1
- TitleLabel.Parent = TitleFrame
- local TitleBox = Instance.new("TextBox")
- TitleBox.Size = UDim2.new(1, 0, 0, 40)
- TitleBox.Position = UDim2.new(0, 0, 0, 25)
- TitleBox.BackgroundColor3 = Color3.fromRGB(65, 65, 65)
- TitleBox.Text = ""
- TitleBox.PlaceholderText = "Enter paste title"
- TitleBox.TextColor3 = Color3.new(1, 1, 1)
- TitleBox.Font = Enum.Font.SourceSans
- TitleBox.TextSize = 16
- TitleBox.Parent = TitleFrame
- local TitleCorner = Instance.new("UICorner")
- TitleCorner.CornerRadius = UDim.new(0, 6)
- TitleCorner.Parent = TitleBox
- local ContentFrame = Instance.new("Frame")
- ContentFrame.Size = UDim2.new(0.9, 0, 0, 120)
- ContentFrame.Position = UDim2.new(0.05, 0, 0.52, 0)
- ContentFrame.BackgroundTransparency = 1
- ContentFrame.Parent = MainFrame
- local ContentLabel = Instance.new("TextLabel")
- ContentLabel.Size = UDim2.new(1, 0, 0, 20)
- ContentLabel.Text = "Paste Content:"
- ContentLabel.TextColor3 = Color3.new(1, 1, 1)
- ContentLabel.Font = Enum.Font.SourceSans
- ContentLabel.TextSize = 18
- ContentLabel.TextXAlignment = Enum.TextXAlignment.Left
- ContentLabel.BackgroundTransparency = 1
- ContentLabel.Parent = ContentFrame
- local ContentBox = Instance.new("TextBox")
- ContentBox.Size = UDim2.new(1, 0, 0, 90)
- ContentBox.Position = UDim2.new(0, 0, 0, 25)
- ContentBox.BackgroundColor3 = Color3.fromRGB(65, 65, 65)
- ContentBox.Text = ""
- ContentBox.PlaceholderText = "Enter your content here"
- ContentBox.TextColor3 = Color3.new(1, 1, 1)
- ContentBox.Font = Enum.Font.SourceSans
- ContentBox.TextSize = 16
- ContentBox.TextWrapped = true
- ContentBox.MultiLine = true
- ContentBox.Parent = ContentFrame
- local ContentCorner = Instance.new("UICorner")
- ContentCorner.CornerRadius = UDim.new(0, 6)
- ContentCorner.Parent = ContentBox
- local UploadButton = Instance.new("TextButton")
- UploadButton.Size = UDim2.new(0.9, 0, 0, 40)
- UploadButton.Position = UDim2.new(0.05, 0, 0.85, 0)
- UploadButton.BackgroundColor3 = Color3.fromRGB(0, 120, 215)
- UploadButton.Text = "UPLOAD TO PASTEBIN"
- UploadButton.TextColor3 = Color3.new(1, 1, 1)
- UploadButton.Font = Enum.Font.SourceSansBold
- UploadButton.TextSize = 18
- UploadButton.Parent = MainFrame
- local ButtonCorner = Instance.new("UICorner")
- ButtonCorner.CornerRadius = UDim.new(0, 6)
- ButtonCorner.Parent = UploadButton
- local StatusLabel = Instance.new("TextLabel")
- StatusLabel.Size = UDim2.new(0.9, 0, 0, 20)
- StatusLabel.Position = UDim2.new(0.05, 0, 0.75, 0)
- StatusLabel.BackgroundTransparency = 1
- StatusLabel.Text = "Status: Ready"
- StatusLabel.TextColor3 = Color3.new(1, 1, 1)
- StatusLabel.Font = Enum.Font.SourceSans
- StatusLabel.TextSize = 16
- StatusLabel.TextXAlignment = Enum.TextXAlignment.Left
- StatusLabel.Parent = MainFrame
- print("Pastebin Uploader GUI initialized successfully")
- print("Note: You need a valid Pastebin API key from https://pastebin.com/doc_api")
- local dragging = false
- local dragStart, frameStart
- TitleBar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- frameStart = MainFrame.Position
- end
- end)
- TitleBar.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- game:GetService("UserInputService").InputChanged:Connect(function(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local delta = input.Position - dragStart
- MainFrame.Position = UDim2.new(
- frameStart.X.Scale,
- frameStart.X.Offset + delta.X,
- frameStart.Y.Scale,
- frameStart.Y.Offset + delta.Y
- )
- end
- end)
- CloseButton.MouseButton1Click:Connect(function()
- ScreenGui:Destroy()
- print("Pastebin Uploader closed")
- end)
- -- Url format func
- local function urlEncode(str)
- if str then
- str = string.gsub(str, "\n", "\r\n")
- str = string.gsub(str, "([^%w ])", function(c)
- return string.format("%%%02X", string.byte(c))
- end)
- str = string.gsub(str, " ", "+")
- end
- return str
- end
- -- Clipboard func
- local function setClipboard(text)
- if setclipboard then
- setclipboard(text) -- Most executors
- elseif writeclipboard then
- writeclipboard(text) -- Some executors
- elseif game:GetService("TextService"):IsClipboardSupported() then
- game:GetService("TextService"):SetClipboard(text) -- Roblox Studio
- else
- print("Clipboard not supported - Paste URL: " .. text)
- end
- end
- local function uploadToPastebin()
- StatusLabel.Text = "Status: Uploading..."
- StatusLabel.TextColor3 = Color3.new(1, 1, 0) -- Yellow
- local apiKey = ApiKeyBox.Text
- local pasteName = TitleBox.Text
- local pasteContent = ContentBox.Text
- if apiKey == "" then
- warn("API Key is required!")
- StatusLabel.Text = "Status: API Key required!"
- StatusLabel.TextColor3 = Color3.new(1, 0.3, 0.3) -- Red
- return
- end
- if pasteContent == "" then
- warn("Content cannot be empty!")
- StatusLabel.Text = "Status: Content cannot be empty!"
- StatusLabel.TextColor3 = Color3.new(1, 0.3, 0.3) -- Red
- return
- end
- print("Starting upload process...")
- local postData = {
- api_dev_key = apiKey,
- api_option = "paste",
- api_paste_code = pasteContent,
- api_paste_name = pasteName ~= "" and pasteName or "Untitled Paste",
- api_paste_format = "text",
- api_paste_private = "1" -- 0=public, 1=unlisted, 2=private
- }
- local formattedData = ""
- for key, value in pairs(postData) do
- formattedData = formattedData .. key .. "=" .. urlEncode(tostring(value)) .. "&"
- end
- formattedData = formattedData:sub(1, -2) -- Remove trailing &
- print("Sending POST request to Pastebin API...")
- local success, response = pcall(function()
- if http_post then
- return http_post(PASTEBIN_API_URL, formattedData, {
- ["Content-Type"] = "application/x-www-form-urlencoded"
- })
- elseif request then
- return request({
- Url = PASTEBIN_API_URL,
- Method = "POST",
- Headers = {
- ["Content-Type"] = "application/x-www-form-urlencoded"
- },
- Body = formattedData
- }).Body
- elseif syn then
- return syn.request({
- Url = PASTEBIN_API_URL,
- Method = "POST",
- Headers = {
- ["Content-Type"] = "application/x-www-form-urlencoded"
- },
- Body = formattedData
- }).Body
- else
- return game:GetService("HttpService"):PostAsync(PASTEBIN_API_URL, formattedData, Enum.HttpContentType.ApplicationUrlEncoded)
- end
- end)
- if success then
- if response:match("^https?://") then
- print("Upload successful! Paste URL: " .. response)
- setClipboard(response)
- StatusLabel.Text = "Status: Success! URL copied to clipboard"
- StatusLabel.TextColor3 = Color3.new(0.3, 1, 0.3) -- Green
- else
- warn("Upload failed: " .. response)
- StatusLabel.Text = "Status: Error - " .. response
- StatusLabel.TextColor3 = Color3.new(1, 0.3, 0.3) -- Red
- end
- else
- warn("HTTP Request failed: " .. tostring(response))
- StatusLabel.Text = "Status: Request failed - " .. tostring(response)
- StatusLabel.TextColor3 = Color3.new(1, 0.3, 0.3) -- Red
- end
- end
- UploadButton.MouseButton1Click:Connect(uploadToPastebin)
- print("Pastebin Uploader script loaded successfully")
Advertisement