EzBridge test chat
Key RequiredUniversal

EzBridge test chat

Universal ScriptTerminator_sbTerminator_sb 35 views 10 executesUpdated Aug 10, 2026
Unrated
00
Lua Script•588 lines (17791 chars)
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
local StarterGui = game:GetService("StarterGui")
local UserInputService = game:GetService("UserInputService")
local MarketplaceService = game:GetService("MarketplaceService")
local TeleportService = game:GetService("TeleportService")

local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")

local TUNNEL_URL = "https://perth-tan-july-stand.trycloudflare.com/remote"
local AUTH_KEY = "TuoB6PfnWN"

local clientId = HttpService:GenerateGUID(false)
local isAnon = false
local showGame = true
local lastMessageTime = 0
local isTyping = false
local lastTypeTime = 0
local isRunning = true
local receivedMessageIds = {}

local gameName = "Unknown Game"
pcall(function()
	local info = MarketplaceService:GetProductInfo(game.PlaceId)
	if info and info.Name then
		gameName = info.Name
	end
end)

local reqFunc = (syn and syn.request) or (http and http.request) or http_request or (fluxus and fluxus.request) or request
if not reqFunc then
	StarterGui:SetCore("SendNotification", {
		Title = "CONNECTION ERROR",
		Text = "HTTP Request function not supported by executor.",
		Duration = 5
	})
	return
end

local function sendRemote(eventType, payloadData)
	if not isRunning then return nil end
	local body = HttpService:JSONEncode({
		type = eventType,
		data = payloadData
	})
	
	local response = nil
	local success = pcall(function()
		response = reqFunc({
			Url = TUNNEL_URL,
			Method = "POST",
			Headers = {
				["Content-Type"] = "application/json",
				["auth-token"] = AUTH_KEY
			},
			Body = body
		})
	end)

	if success and response and response.StatusCode == 200 then
		local jsonSuccess, decoded = pcall(function()
			return HttpService:JSONDecode(response.Body)
		end)
		if jsonSuccess and decoded and decoded.events then
			return decoded.events
		end
	end
	return nil
end

local screenGui = Instance.new("ScreenGui")
screenGui.Name = "EzBridgeChatGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = PlayerGui

local loadingOverlay = Instance.new("Frame")
loadingOverlay.Size = UDim2.new(1, 0, 1, 0)
loadingOverlay.BackgroundColor3 = Color3.fromRGB(128, 128, 128)
loadingOverlay.BackgroundTransparency = 0.5
loadingOverlay.Parent = screenGui

local loadingText = Instance.new("TextLabel")
loadingText.Size = UDim2.new(0, 300, 0, 50)
loadingText.Position = UDim2.new(0.5, -150, 0.5, -25)
loadingText.BackgroundTransparency = 1
loadingText.Text = "connecting to EzBridge..."
loadingText.TextColor3 = Color3.fromRGB(255, 255, 255)
loadingText.TextSize = 22
loadingText.Font = Enum.Font.SourceSansBold
loadingText.Parent = loadingOverlay

local initialConnectSuccess = false
for i = 1, 3 do
	local evts = sendRemote("heartbeat", {
		senderId = clientId,
		displayName = LocalPlayer.DisplayName,
		isAnon = isAnon,
		showGame = showGame,
		gameName = gameName,
		placeId = game.PlaceId,
		jobId = game.JobId
	})
	if evts then
		initialConnectSuccess = true
		break
	end
	task.wait(1)
end

loadingOverlay:Destroy()

if not initialConnectSuccess then
	pcall(function()
		StarterGui:SetCore("SendNotification", {
			Title = "CONNECTION ERROR",
			Text = "Failed to connect to EzBridge, the server may be offline at this moment.",
			Duration = 5
		})
	end)
	screenGui:Destroy()
	return
end

local toggleButton = Instance.new("ImageButton")
toggleButton.Size = UDim2.new(0, 45, 0, 45)
toggleButton.Position = UDim2.new(0, 20, 0.5, -22)
toggleButton.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
toggleButton.BorderSizePixel = 0
toggleButton.Parent = screenGui

local btnCorner = Instance.new("UICorner")
btnCorner.CornerRadius = UDim.new(0, 8)
btnCorner.Parent = toggleButton

local rainbowUIStroke = Instance.new("UIStroke")
rainbowUIStroke.Thickness = 3
rainbowUIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
rainbowUIStroke.Parent = toggleButton

local btnIcon = Instance.new("TextLabel")
btnIcon.Size = UDim2.new(1, 0, 1, 0)
btnIcon.BackgroundTransparency = 1
btnIcon.Text = "💬"
btnIcon.TextSize = 22
btnIcon.Parent = toggleButton

local dragging = false
local dragInput, dragStart, startPos

toggleButton.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
		dragging = true
		dragStart = input.Position
		startPos = toggleButton.Position
		input.Changed:Connect(function()
			if input.UserInputState == Enum.UserInputState.End then
				dragging = false
			end
		end)
	end
end)

toggleButton.InputChanged:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
		dragInput = input
	end
end)

UserInputService.InputChanged:Connect(function(input)
	if input == dragInput and dragging then
		local delta = input.Position - dragStart
		toggleButton.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
	end
end)

local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 420, 0, 300)
mainFrame.Position = UDim2.new(0.5, -210, 0.5, -150)
mainFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 25)
mainFrame.BorderSizePixel = 0
mainFrame.Visible = false
mainFrame.Parent = screenGui

local mainCorner = Instance.new("UICorner")
mainCorner.CornerRadius = UDim.new(0, 10)
mainCorner.Parent = mainFrame

local titleHeader = Instance.new("Frame")
titleHeader.Size = UDim2.new(1, -50, 0, 40)
titleHeader.BackgroundTransparency = 1
titleHeader.Parent = mainFrame

local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1, -10, 1, 0)
titleLabel.Position = UDim2.new(0, 10, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "EzBridge global chat | 0 Online | 0 typing"
titleLabel.TextColor3 = Color3.fromRGB(230, 230, 230)
titleLabel.TextSize = 14
titleLabel.Font = Enum.Font.SourceSansBold
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.Parent = titleHeader

local sidebar = Instance.new("Frame")
sidebar.Size = UDim2.new(0, 50, 1, 0)
sidebar.Position = UDim2.new(1, -50, 0, 0)
sidebar.BackgroundColor3 = Color3.fromRGB(15, 15, 20)
sidebar.BorderSizePixel = 0
sidebar.Parent = mainFrame

local sideCorner = Instance.new("UICorner")
sideCorner.CornerRadius = UDim.new(0, 10)
sideCorner.Parent = sidebar

local chatTabBtn = Instance.new("TextButton")
chatTabBtn.Size = UDim2.new(0, 35, 0, 35)
chatTabBtn.Position = UDim2.new(0.5, -17, 0, 10)
chatTabBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
chatTabBtn.Text = "💬"
chatTabBtn.TextSize = 18
chatTabBtn.Parent = sidebar

local chatTabCorner = Instance.new("UICorner")
chatTabCorner.CornerRadius = UDim.new(0, 6)
chatTabCorner.Parent = chatTabBtn

local settingsTabBtn = Instance.new("TextButton")
settingsTabBtn.Size = UDim2.new(0, 35, 0, 35)
settingsTabBtn.Position = UDim2.new(0.5, -17, 0, 50)
settingsTabBtn.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
settingsTabBtn.Text = "⚙️"
settingsTabBtn.TextSize = 18
settingsTabBtn.Parent = sidebar

local settingsTabCorner = Instance.new("UICorner")
settingsTabCorner.CornerRadius = UDim.new(0, 6)
settingsTabCorner.Parent = settingsTabBtn

local chatContainer = Instance.new("Frame")
chatContainer.Size = UDim2.new(1, -55, 1, -45)
chatContainer.Position = UDim2.new(0, 5, 0, 40)
chatContainer.BackgroundTransparency = 1
chatContainer.Parent = mainFrame

local scrollFeed = Instance.new("ScrollingFrame")
scrollFeed.Size = UDim2.new(1, 0, 1, -40)
scrollFeed.BackgroundTransparency = 1
scrollFeed.BorderSizePixel = 0
scrollFeed.CanvasSize = UDim2.new(0, 0, 0, 0)
scrollFeed.ScrollBarThickness = 4
scrollFeed.Parent = chatContainer

local feedLayout = Instance.new("UIListLayout")
feedLayout.SortOrder = Enum.SortOrder.LayoutOrder
feedLayout.Padding = UDim.new(0, 6)
feedLayout.Parent = scrollFeed

feedLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
	scrollFeed.CanvasSize = UDim2.new(0, 0, 0, feedLayout.AbsoluteContentSize.Y + 10)
	scrollFeed.CanvasPosition = Vector2.new(0, feedLayout.AbsoluteContentSize.Y)
end)

local inputContainer = Instance.new("Frame")
inputContainer.Size = UDim2.new(1, 0, 0, 32)
inputContainer.Position = UDim2.new(0, 0, 1, -35)
inputContainer.BackgroundColor3 = Color3.fromRGB(30, 30, 38)
inputContainer.Parent = chatContainer

local inputCorner = Instance.new("UICorner")
inputCorner.CornerRadius = UDim.new(0, 6)
inputCorner.Parent = inputContainer

local chatBox = Instance.new("TextBox")
chatBox.Size = UDim2.new(1, -50, 1, 0)
chatBox.Position = UDim2.new(0, 8, 0, 0)
chatBox.BackgroundTransparency = 1
chatBox.PlaceholderText = "Type a message... (Max 200 chars)"
chatBox.Text = ""
chatBox.TextColor3 = Color3.fromRGB(255, 255, 255)
chatBox.TextSize = 13
chatBox.Font = Enum.Font.SourceSans
chatBox.TextXAlignment = Enum.TextXAlignment.Left
chatBox.ClearTextOnFocus = false
chatBox.Parent = inputContainer

local sendBtn = Instance.new("TextButton")
sendBtn.Size = UDim2.new(0, 35, 1, 0)
sendBtn.Position = UDim2.new(1, -38, 0, 0)
sendBtn.BackgroundTransparency = 1
sendBtn.Text = "➔"
sendBtn.TextColor3 = Color3.fromRGB(0, 170, 255)
sendBtn.TextSize = 16
sendBtn.Parent = inputContainer

local settingsContainer = Instance.new("Frame")
settingsContainer.Size = UDim2.new(1, -55, 1, -45)
settingsContainer.Position = UDim2.new(0, 5, 0, 40)
settingsContainer.BackgroundTransparency = 1
settingsContainer.Visible = false
settingsContainer.Parent = mainFrame

local settingsLayout = Instance.new("UIListLayout")
settingsLayout.SortOrder = Enum.SortOrder.LayoutOrder
settingsLayout.Padding = UDim.new(0, 8)
settingsLayout.Parent = settingsContainer

local function createSettingToggle(label, defaultState, callback)
	local frame = Instance.new("Frame")
	frame.Size = UDim2.new(1, -10, 0, 35)
	frame.BackgroundColor3 = Color3.fromRGB(28, 28, 35)
	frame.Parent = settingsContainer
	
	local corner = Instance.new("UICorner")
	corner.CornerRadius = UDim.new(0, 6)
	corner.Parent = frame

	local txt = Instance.new("TextLabel")
	txt.Size = UDim2.new(0.7, 0, 1, 0)
	txt.Position = UDim2.new(0, 10, 0, 0)
	txt.BackgroundTransparency = 1
	txt.Text = label
	txt.TextColor3 = Color3.fromRGB(220, 220, 220)
	txt.TextSize = 13
	txt.Font = Enum.Font.SourceSans
	txt.TextXAlignment = Enum.TextXAlignment.Left
	txt.Parent = frame

	local btn = Instance.new("TextButton")
	btn.Size = UDim2.new(0, 60, 0, 25)
	btn.Position = UDim2.new(1, -70, 0.5, -12)
	btn.BackgroundColor3 = defaultState and Color3.fromRGB(40, 160, 80) or Color3.fromRGB(160, 40, 40)
	btn.Text = defaultState and "ON" or "OFF"
	btn.TextColor3 = Color3.fromRGB(255, 255, 255)
	btn.TextSize = 12
	btn.Font = Enum.Font.SourceSansBold
	btn.Parent = frame

	local btnC = Instance.new("UICorner")
	btnC.CornerRadius = UDim.new(0, 4)
	btnC.Parent = btn

	local currentState = defaultState
	btn.MouseButton1Click:Connect(function()
		currentState = not currentState
		btn.Text = currentState and "ON" or "OFF"
		btn.BackgroundColor3 = currentState and Color3.fromRGB(40, 160, 80) or Color3.fromRGB(160, 40, 40)
		callback(currentState)
	end)
end

local function createSettingButton(label, color, callback)
	local btn = Instance.new("TextButton")
	btn.Size = UDim2.new(1, -10, 0, 35)
	btn.BackgroundColor3 = color
	btn.Text = label
	btn.TextColor3 = Color3.fromRGB(255, 255, 255)
	btn.TextSize = 13
	btn.Font = Enum.Font.SourceSansBold
	btn.Parent = settingsContainer

	local btnC = Instance.new("UICorner")
	btnC.CornerRadius = UDim.new(0, 6)
	btnC.Parent = btn

	btn.MouseButton1Click:Connect(callback)
end

createSettingToggle("Anonymous mode:", false, function(val)
	isAnon = val
end)

createSettingToggle("Show what game am i playing:", true, function(val)
	showGame = val
end)

createSettingButton("re-execute script", Color3.fromRGB(45, 85, 145), function()
	isRunning = false
	screenGui:Destroy()
	task.defer(function()
		loadstring(game:HttpGet(TUNNEL_URL))()
	end)
end)

createSettingButton("kill script", Color3.fromRGB(145, 45, 45), function()
	isRunning = false
	screenGui:Destroy()
end)

chatTabBtn.MouseButton1Click:Connect(function()
	chatContainer.Visible = true
	settingsContainer.Visible = false
	chatTabBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
	settingsTabBtn.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
end)

settingsTabBtn.MouseButton1Click:Connect(function()
	chatContainer.Visible = false
	settingsContainer.Visible = true
	chatTabBtn.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
	settingsTabBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
end)

toggleButton.MouseButton1Click:Connect(function()
	mainFrame.Visible = not mainFrame.Visible
end)

local function appendMessage(msg)
	if not msg or not msg.id or receivedMessageIds[msg.id] then return end
	receivedMessageIds[msg.id] = true

	local msgFrame = Instance.new("Frame")
	msgFrame.Size = UDim2.new(1, -10, 0, 0)
	msgFrame.BackgroundColor3 = Color3.fromRGB(28, 28, 35)
	msgFrame.AutomaticSize = Enum.AutomaticSize.Y
	msgFrame.Parent = scrollFeed

	local corner = Instance.new("UICorner")
	corner.CornerRadius = UDim.new(0, 6)
	corner.Parent = msgFrame

	local layout = Instance.new("UIListLayout")
	layout.SortOrder = Enum.SortOrder.LayoutOrder
	layout.Padding = UDim.new(0, 2)
	layout.Parent = msgFrame

	local pad = Instance.new("UIPadding")
	pad.PaddingLeft = UDim.new(0, 6)
	pad.PaddingRight = UDim.new(0, 6)
	pad.PaddingTop = UDim.new(0, 4)
	pad.PaddingBottom = UDim.new(0, 4)
	pad.Parent = msgFrame

	if msg.showGame and msg.gameName and msg.gameName ~= "" then
		local gameBanner = Instance.new("Frame")
		gameBanner.Size = UDim2.new(1, 0, 0, 18)
		gameBanner.BackgroundTransparency = 1
		gameBanner.LayoutOrder = 1
		gameBanner.Parent = msgFrame

		local gameTxt = Instance.new("TextLabel")
		gameTxt.Size = UDim2.new(0.7, 0, 1, 0)
		gameTxt.BackgroundTransparency = 1
		gameTxt.Text = "🎮 " .. msg.gameName
		gameTxt.TextColor3 = Color3.fromRGB(150, 200, 255)
		gameTxt.TextSize = 10
		gameTxt.Font = Enum.Font.SourceSans
		gameTxt.TextXAlignment = Enum.TextXAlignment.Left
		gameTxt.Parent = gameBanner

		if msg.placeId and msg.jobId and msg.jobId ~= "" then
			local joinBtn = Instance.new("TextButton")
			joinBtn.Size = UDim2.new(0, 60, 1, 0)
			joinBtn.Position = UDim2.new(1, -60, 0, 0)
			joinBtn.BackgroundColor3 = Color3.fromRGB(0, 140, 70)
			joinBtn.Text = "JOIN GAME"
			joinBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
			joinBtn.TextSize = 9
			joinBtn.Font = Enum.Font.SourceSansBold
			joinBtn.Parent = gameBanner

			local jCorner = Instance.new("UICorner")
			jCorner.CornerRadius = UDim.new(0, 4)
			jCorner.Parent = joinBtn

			joinBtn.MouseButton1Click:Connect(function()
				TeleportService:TeleportToPlaceInstance(msg.placeId, msg.jobId, LocalPlayer)
			end)
		end
	end

	local nameTxt = Instance.new("TextLabel")
	nameTxt.Size = UDim2.new(1, 0, 0, 14)
	nameTxt.BackgroundTransparency = 1
	nameTxt.Text = msg.senderName
	nameTxt.TextColor3 = Color3.fromRGB(255, 180, 0)
	nameTxt.TextSize = 11
	nameTxt.Font = Enum.Font.SourceSansBold
	nameTxt.TextXAlignment = Enum.TextXAlignment.Left
	nameTxt.LayoutOrder = 2
	nameTxt.Parent = msgFrame

	local contentTxt = Instance.new("TextLabel")
	contentTxt.Size = UDim2.new(1, 0, 0, 0)
	contentTxt.AutomaticSize = Enum.AutomaticSize.Y
	contentTxt.BackgroundTransparency = 1
	contentTxt.Text = msg.text
	contentTxt.TextColor3 = Color3.fromRGB(230, 230, 230)
	contentTxt.TextSize = 12
	contentTxt.Font = Enum.Font.SourceSans
	contentTxt.TextXAlignment = Enum.TextXAlignment.Left
	contentTxt.TextWrapped = true
	contentTxt.LayoutOrder = 3
	contentTxt.Parent = msgFrame
end

local function handleEvents(events)
	if not events then return end
	for _, evt in ipairs(events) do
		if evt.type == "stats_update" then
			titleLabel.Text = string.format("EzBridge global chat | %d Online | %d typing", evt.data.online or 0, evt.data.typing or 0)
		elseif evt.type == "new_message" then
			appendMessage(evt.data)
		elseif evt.type == "history_chunk" then
			if evt.data.targetId == clientId and evt.data.messages then
				for _, msg in ipairs(evt.data.messages) do
					appendMessage(msg)
				end
			end
		end
	end
end

local function sendMessage()
	local text = chatBox.Text
	if #text < 1 or #text > 200 then return end
	if os.time() - lastMessageTime < 1 then return end

	lastMessageTime = os.time()
	chatBox.Text = ""

	local responseEvents = sendRemote("send_message", {
		senderId = clientId,
		senderName = LocalPlayer.DisplayName,
		text = text,
		isAnon = isAnon,
		showGame = showGame,
		gameName = gameName,
		placeId = game.PlaceId,
		jobId = game.JobId
	})
	handleEvents(responseEvents)
end

sendBtn.MouseButton1Click:Connect(sendMessage)
chatBox.FocusLost:Connect(function(enterPressed)
	if enterPressed then
		sendMessage()
	end
end)

chatBox:GetPropertyChangedSignal("Text"):Connect(function()
	lastTypeTime = os.time()
	if not isTyping then
		isTyping = true
		sendRemote("typing_status", { senderId = clientId, isTyping = true })
	end
end)

task.spawn(function()
	while isRunning do
		if isTyping and (os.time() - lastTypeTime >= 3) then
			isTyping = false
			sendRemote("typing_status", { senderId = clientId, isTyping = false })
		end
		task.wait(0.5)
	end
end)

local historyEvents = sendRemote("request_history", { senderId = clientId })
handleEvents(historyEvents)

task.spawn(function()
	local hue = 0
	while isRunning do
		hue = (hue + 0.005) % 1
		rainbowUIStroke.Color = Color3.fromHSV(hue, 0.8, 1)
		task.wait(0.03)
	end
end)

task.spawn(function()
	while isRunning do
		local events = sendRemote("heartbeat", {
			senderId = clientId,
			displayName = LocalPlayer.DisplayName,
			isAnon = isAnon,
			showGame = showGame,
			gameName = gameName,
			placeId = game.PlaceId,
			jobId = game.JobId,
			isTyping = isTyping
		})

		handleEvents(events)
		task.wait(1)
	end
end)

Features & Information

this is a script to test my universal server

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts