Run it
Copy the script and paste it into your executor.
Players = :()
HttpService = :()
UserInputService = :()
LocalPlayer = Players.LocalPlayer
PlayerGui = LocalPlayer:()
API_BASE =
JOIN_URL = API_BASE ..
LEAVE_URL = API_BASE ..
SEND_URL = API_BASE ..
MESSAGES_URL = API_BASE ..
ONLINE_URL = API_BASE ..
HEARTBEAT_URL = API_BASE ..
POLL_INTERVAL =
ONLINE_INTERVAL =
HEARTBEAT_INTERVAL =
MAX_MESSAGE_LEN =
(str)
ok, r = (() HttpService:(str) )
ok r
(tbl)
ok, r = (() HttpService:(tbl) )
ok r
(method, url, bodyTable)
body = bodyTable (bodyTable)
() ==
ok, res = (()
({
Url = url, Method = method,
Headers = body { [] = } {},
Body = body,
})
)
ok res
success = res.Success (res.StatusCode res.StatusCode >= res.StatusCode < )
success, res.Body
method ==
ok, res = (() :(url) )
ok, res
method ==
ok, res = (() :(url, body, ) )
ok, res
,
(text)
text = (text )
text = text:(,):(,):(,)
text
(text)
((text ):(, ))
(ts)
ok, r = (()
.(, .((ts) .()))
)
ok r
gui = .()
gui.Name =
gui.ResetOnSpawn =
gui.IgnoreGuiInset =
gui.Parent = PlayerGui
main = .()
main.AnchorPoint = .(, )
main.Position = .(, , , )
main.Size = .(, , , )
main.BackgroundColor3 = .(, , )
main.BorderSizePixel =
main.Parent = gui
c = .(); c.CornerRadius = .(, ); c.Parent = main
s = .(); s.Thickness = ; s.Transparency =
s.Color = .(,,); s.Parent = main
lim = .()
lim.MinSize = .(, ); lim.MaxSize = .(, ); lim.Parent = main
topBar = .()
topBar.Size = .(, , , )
topBar.BackgroundColor3 = .(, , )
topBar.BorderSizePixel =
topBar.Parent = main
tc = .(); tc.CornerRadius = .(, ); tc.Parent = topBar
tm = .()
tm.Size = .(, , , ); tm.Position = .(, , , -)
tm.BackgroundColor3 = .(,,); tm.BorderSizePixel = ; tm.Parent = topBar
titleLbl = .()
titleLbl.BackgroundTransparency =
titleLbl.Size = .(, -, , ); titleLbl.Position = .(, , , )
titleLbl.Font = .Font.GothamBold; titleLbl.Text =
titleLbl.TextColor3 = .(,,); titleLbl.TextSize =
titleLbl.TextXAlignment = .TextXAlignment.Left; titleLbl.Parent = topBar
onlineLabel = .()
onlineLabel.BackgroundTransparency =
onlineLabel.Size = .(, , , ); onlineLabel.Position = .(, -, , )
onlineLabel.Font = .Font.Gotham; onlineLabel.Text =
onlineLabel.TextColor3 = .(,,); onlineLabel.TextSize =
onlineLabel.TextXAlignment = .TextXAlignment.Right; onlineLabel.Parent = topBar
statusLabel = .()
statusLabel.BackgroundTransparency =
statusLabel.Size = .(, -, , ); statusLabel.Position = .(, , , )
statusLabel.Font = .Font.Gotham; statusLabel.Text =
statusLabel.TextColor3 = .(,,); statusLabel.TextSize =
statusLabel.TextXAlignment = .TextXAlignment.Left; statusLabel.Parent = main
messagesFrame = .()
messagesFrame.Size = .(, -, , -)
messagesFrame.Position = .(, , , )
messagesFrame.BackgroundColor3 = .(,,)
messagesFrame.BorderSizePixel = ; messagesFrame.ScrollBarThickness =
messagesFrame.CanvasSize = .(,,,)
messagesFrame.AutomaticCanvasSize = .AutomaticSize.Y
messagesFrame.ScrollingDirection = .ScrollingDirection.Y
messagesFrame.Parent = main
mc = .(); mc.CornerRadius = .(, ); mc.Parent = messagesFrame
mp = .()
mp.PaddingTop = .(,); mp.PaddingBottom = .(,)
mp.PaddingLeft = .(,); mp.PaddingRight = .(,); mp.Parent = messagesFrame
layout = .()
layout.Padding = .(, ); layout.SortOrder = .SortOrder.LayoutOrder
layout.Parent = messagesFrame
inputFrame = .()
inputFrame.Size = .(, -, , ); inputFrame.Position = .(, , , -)
inputFrame.BackgroundTransparency = ; inputFrame.Parent = main
textBox = .()
textBox.Size = .(, -, , )
textBox.BackgroundColor3 = .(,,); textBox.BorderSizePixel =
textBox.ClearTextOnFocus = ; textBox.PlaceholderText =
textBox.Text = ; textBox.Font = .Font.Gotham; textBox.TextSize =
textBox.TextColor3 = .(,,)
textBox.PlaceholderColor3 = .(,,)
textBox.TextXAlignment = .TextXAlignment.Left; textBox.Parent = inputFrame
tbc = .(); tbc.CornerRadius = .(,); tbc.Parent = textBox
tbp = .()
tbp.PaddingLeft = .(,); tbp.PaddingRight = .(,); tbp.Parent = textBox
sendButton = .()
sendButton.Size = .(, , , ); sendButton.Position = .(, -, , )
sendButton.BackgroundColor3 = .(,,); sendButton.BorderSizePixel =
sendButton.Text = ; sendButton.Font = .Font.GothamBold; sendButton.TextSize =
sendButton.TextColor3 = .(,,); sendButton.Parent = inputFrame
sc = .(); sc.CornerRadius = .(,); sc.Parent = sendButton
messageCount =
()
.(()
messagesFrame.CanvasPosition = .(, .huge)
)
(entry)
entry
messageCount +=
username = (entry.username )
message = (entry.message )
timeStr = (entry.timestamp)
row = .()
row.BackgroundTransparency =
row.Size = .(, , , )
row.AutomaticSize = .AutomaticSize.Y
row.LayoutOrder = messageCount
row.Parent = messagesFrame
label = .()
label.BackgroundTransparency =
label.Size = .(, , , )
label.AutomaticSize = .AutomaticSize.Y
label.Font = .Font.Gotham; label.TextSize =
label.TextWrapped = ; label.RichText =
label.TextXAlignment = .TextXAlignment.Left
label.TextYAlignment = .TextYAlignment.Top
label.TextColor3 = .(,,)
label.Text = .(
,
timeStr, username, message
)
label.Parent = row
()
(text, color)
statusLabel.Text = text
statusLabel.TextColor3 = color .(,,)
dragging, dragInput, dragStart, startPos = , , ,
topBar.InputBegan:((input)
input.UserInputType == .UserInputType.MouseButton1
input.UserInputType == .UserInputType.Touch
dragging = ; dragStart = input.Position; startPos = main.Position
input.Changed:(()
input.UserInputState == .UserInputState.End dragging =
)
)
topBar.InputChanged:((input)
input.UserInputType == .UserInputType.MouseMovement
input.UserInputType == .UserInputType.Touch dragInput = input
)
UserInputService.InputChanged:((input)
dragging input == dragInput
delta = input.Position - dragStart
main.Position = .(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
)
lastId =
sending =
alive =
(afterId, limit)
url = .(, MESSAGES_URL, afterId, limit)
ok, res = (, url)
ok
(res)
()
ok, res = (, ONLINE_URL)
ok
data = (res)
data data.count ~=
onlineLabel.Text = .. (data.count)
()
sending
text = (textBox.Text)
text ==
#text > MAX_MESSAGE_LEN text = text:(, MAX_MESSAGE_LEN)
sending = ; sendButton.Text = ; sendButton.Active =
ok = (, SEND_URL, {
username = LocalPlayer.Name,
userId = (LocalPlayer.UserId),
message = text,
})
ok textBox.Text = ; (, .(,,))
(, .(,,))
sendButton.Text = ; sendButton.Active = ; sending =
sendButton.MouseButton1Click:(sendChatMessage)
textBox.FocusLost:((enter) enter () )
.(()
(, JOIN_URL, {
username = LocalPlayer.Name,
userId = (LocalPlayer.UserId),
})
()
data = (, )
data data.messages
.(data.messages, (a,b) ((a.id) ) < ((b.id) ) )
_, msg (data.messages)
(msg)
lastId = .(lastId, (msg.id) )
()
(, .(,,))
)
.(()
alive
.(POLL_INTERVAL)
data = (lastId, )
data data.messages
_, msg (data.messages)
id = (msg.id)
id > lastId (msg); lastId = id
)
.(()
alive
.(ONLINE_INTERVAL)
()
)
.(()
alive
.(HEARTBEAT_INTERVAL)
(, HEARTBEAT_URL, { userId = (LocalPlayer.UserId) })
)
(()
:(()
alive =
(, LEAVE_URL, {
username = LocalPlayer.Name,
userId = (LocalPlayer.UserId),
})
)
)Loads code from the internet. It downloads more code when it runs (loadstring + HttpGet), which can change after it was posted. From: mii-response-server--721843.replit.app.
Universal chat with working servers allowing multiple hackers to chat across games