local HttpService = game:GetService("HttpService") local TweenService = game:GetService("TweenService") local Players = game:GetService("Players") local TextChatService = game:GetService("TextChatService") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") -- Replace with your actual Render URL local BASE_URL = "https://mrbeastbot-bsyd.onrender.com" local POLL_ENDPOINT = BASE_URL .. "/poll" local CHAT_ENDPOINT = BASE_URL .. "/chat" --------------------------------------------------------- -- Fullscreen Modern iOS-style Popup Setup --------------------------------------------------------- local screenGui = Instance.new("ScreenGui") screenGui.Name = "DiscordBridgeGui" screenGui.ResetOnSpawn = false screenGui.DisplayOrder = 999 screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling screenGui.Parent = PlayerGui local overlay = Instance.new("Frame") overlay.Name = "Overlay" overlay.Size = UDim2.new(1, 0, 1, 0) overlay.BackgroundColor3 = Color3.fromRGB(0, 0, 0) overlay.BackgroundTransparency = 1 overlay.BorderSizePixel = 0 overlay.Visible = false overlay.Parent = screenGui local mainCard = Instance.new("Frame") mainCard.Name = "MainCard" mainCard.Size = UDim2.new(0, 480, 0, 260) mainCard.Position = UDim2.new(0.5, 0, 0.55, 0) mainCard.AnchorPoint = Vector2.new(0.5, 0.5) mainCard.BackgroundColor3 = Color3.fromRGB(20, 20, 25) mainCard.BackgroundTransparency = 1 mainCard.BorderSizePixel = 0 mainCard.Parent = overlay local cardCorner = Instance.new("UICorner") cardCorner.CornerRadius = UDim.new(0, 20) cardCorner.Parent = mainCard local cardStroke = Instance.new("UIStroke") cardStroke.Color = Color3.fromRGB(60, 60, 75) cardStroke.Thickness = 1.2 cardStroke.Transparency = 1 cardStroke.Parent = mainCard local headerBar = Instance.new("Frame") headerBar.Size = UDim2.new(1, 0, 0, 48) headerBar.BackgroundTransparency = 1 headerBar.Parent = mainCard local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1, -70, 1, 0) titleLabel.Position = UDim2.new(0, 20, 0, 0) titleLabel.BackgroundTransparency = 1 titleLabel.Font = Enum.Font.GothamBold titleLabel.Text = "Discord Message" titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255) titleLabel.TextSize = 16 titleLabel.TextXAlignment = Enum.TextXAlignment.Left titleLabel.Parent = headerBar local closeBtn = Instance.new("TextButton") closeBtn.Name = "CloseBtn" closeBtn.Size = UDim2.new(0, 32, 0, 32) closeBtn.Position = UDim2.new(1, -44, 0.5, -16) closeBtn.BackgroundColor3 = Color3.fromRGB(45, 45, 55) closeBtn.BorderSizePixel = 0 closeBtn.Font = Enum.Font.GothamMedium closeBtn.Text = "✕" closeBtn.TextColor3 = Color3.fromRGB(200, 200, 215) closeBtn.TextSize = 14 closeBtn.Parent = headerBar local closeCorner = Instance.new("UICorner") closeCorner.CornerRadius = UDim.new(1, 0) closeCorner.Parent = closeBtn local scrollContainer = Instance.new("ScrollingFrame") scrollContainer.Size = UDim2.new(1, -40, 1, -68) scrollContainer.Position = UDim2.new(0, 20, 0, 48) scrollContainer.BackgroundTransparency = 1 scrollContainer.BorderSizePixel = 0 scrollContainer.ScrollBarThickness = 3 scrollContainer.ScrollBarImageColor3 = Color3.fromRGB(80, 80, 100) scrollContainer.Parent = mainCard local messageLabel = Instance.new("TextLabel") messageLabel.Size = UDim2.new(1, -10, 1, 0) messageLabel.BackgroundTransparency = 1 messageLabel.Font = Enum.Font.Gotham messageLabel.Text = "" messageLabel.TextColor3 = Color3.fromRGB(220, 220, 235) messageLabel.TextSize = 15 messageLabel.TextWrapped = true messageLabel.TextXAlignment = Enum.TextXAlignment.Left messageLabel.TextYAlignment = Enum.TextYAlignment.Top messageLabel.Parent = scrollContainer --------------------------------------------------------- -- Animation & Show/Hide Controls --------------------------------------------------------- local isOpened = false local function showFullscreenPopup(text) messageLabel.Text = text overlay.Visible = true isOpened = true local tweenInfo = TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out) local fadeInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) TweenService:Create(overlay, fadeInfo, {BackgroundTransparency = 0.55}):Play() TweenService:Create(mainCard, tweenInfo, {Position = UDim2.new(0.5, 0, 0.5, 0), BackgroundTransparency = 0}):Play() TweenService:Create(cardStroke, fadeInfo, {Transparency = 0}):Play() end local function hideFullscreenPopup() if not isOpened then return end isOpened = false local tweenInfo = TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.In) local mainTween = TweenService:Create(mainCard, tweenInfo, {Position = UDim2.new(0.5, 0, 0.55, 0), BackgroundTransparency = 1}) TweenService:Create(overlay, tweenInfo, {BackgroundTransparency = 1}):Play() TweenService:Create(cardStroke, tweenInfo, {Transparency = 1}):Play() mainTween:Play() mainTween.Completed:Connect(function() overlay.Visible = false end) end closeBtn.MouseButton1Click:Connect(hideFullscreenPopup) --------------------------------------------------------- -- Request Utility (Executor compatible + standard HttpService) --------------------------------------------------------- local function makeRequest(url, method, body) if request then return request({ Url = url, Method = method or "GET", Headers = { ["Content-Type"] = "application/json" }, Body = body }) elseif syn and syn.request then return syn.request({ Url = url, Method = method or "GET", Headers = { ["Content-Type"] = "application/json" }, Body = body }) else if method == "POST" then return HttpService:PostAsync(url, body, Enum.HttpContentType.ApplicationJson) else return game:HttpGet(url) end end end --------------------------------------------------------- -- Outbound: Send Roblox Chat to Discord --------------------------------------------------------- local function sendChatToDiscord(messageText) if not messageText or messageText == "" then return end task.spawn(function() local payload = HttpService:JSONEncode({ username = LocalPlayer.Name, message = messageText }) pcall(function() makeRequest(CHAT_ENDPOINT, "POST", payload) end) end) end if TextChatService.ChatInputBarConfiguration then TextChatService.OnIncomingMessage = function(textMessage: TextChatMessage) if textMessage.TextSource and textMessage.TextSource.UserId == LocalPlayer.UserId then sendChatToDiscord(textMessage.Text) end end end LocalPlayer.Chatted:Connect(function(msg) sendChatToDiscord(msg) end) --------------------------------------------------------- -- Inbound: Polling Loop for Discord Messages --------------------------------------------------------- task.spawn(function() local pollUrl = POLL_ENDPOINT .. "?username=" .. HttpService:UrlEncode(LocalPlayer.Name) while true do local success, response = pcall(function() return makeRequest(pollUrl, "GET", nil) end) if success and response then local responseText = type(response) == "table" and (response.Body or response.body) or response local decodeSuccess, data = pcall(function() return HttpService:JSONDecode(responseText) end) if decodeSuccess and data and data.message and data.message ~= "" then showFullscreenPopup(data.message) end end task.wait(1.5) end end)