Universal Script 📌
777 Views
335 Executions

UNIVERSAL CHAT

Universal Script 📌
4P_4P
4P_4P10K executions
8 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
Universal Script 📌
18
0
Approved 20 minutes ago
Universal Script 📌
2.3k
24.6k
Bumped 2 hours ago
Script hub
17.0k
112.3k
Bumped 4 hours ago
Key System

Script hub

Kronos New

Script hub
5.6M
1.2M
Bumped 8 hours ago
Key System
Universal Script 📌
1.9k
6.8k
Bumped 10 hours ago