Universal Script 📌
770 Views
303 Executions

UNIVERSAL CHAT

Universal Script 📌
4P_4P
4P_4PPublished 5
7 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Universal chat with working servers allowing multiple hackers to chat across games

Updates

  1. Script edited: Update script

View Raw
--// Global Chat GUI (2x smaller, heartbeat online tracking)

local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")
local UserInputService = game:GetService("UserInputService")

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

local API_BASE = "https://mii-response-server--721843.replit.app/api"
local JOIN_URL       = API_BASE .. "/chat/join"
local LEAVE_URL      = API_BASE .. "/chat/leave"
local SEND_URL       = API_BASE .. "/chat/send"
local MESSAGES_URL   = API_BASE .. "/chat/messages"
local ONLINE_URL     = API_BASE .. "/chat/online"
local HEARTBEAT_URL  = API_BASE .. "/chat/heartbeat"

local POLL_INTERVAL      = 2
local ONLINE_INTERVAL    = 5
local HEARTBEAT_INTERVAL = 10
local MAX_MESSAGE_LEN    = 300

local function jsonDecodeSafe(str)
	local ok, r = pcall(function() return HttpService:JSONDecode(str) end)
	return ok and r or nil
end

local function jsonEncodeSafe(tbl)
	local ok, r = pcall(function() return HttpService:JSONEncode(tbl) end)
	return ok and r or nil
end

local function httpRequest(method, url, bodyTable)
	local body = bodyTable and jsonEncodeSafe(bodyTable) or nil

	if typeof(request) == "function" then
		local ok, res = pcall(function()
			return request({
				Url = url, Method = method,
				Headers = body and { ["Content-Type"] = "application/json" } or {},


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
47.4k
173.4k
Bumped 30 minutes ago
Key System

Script hub

#4 this month

Verified script badgeArcane Hub | 125+ Games & 4000+ Features

Script hub
173.1k
1.5M
Bumped 1 hour ago
Key System
Script hub
3.1M
734.0k
Bumped 1 hour ago
Key System

Script hub

Hall of Fame #10

Verified script badgeFlow Hub | 50 Games | Updated

Universal Script 📌
5.8k
20.9k
Bumped 3 hours ago
Key System
Script hub
27.1k
1.1k
Bumped 3 hours ago
Key System

Script hub

#1 today

Plak New