cepmoc

Untitled

Feb 28th, 2026
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.31 KB | None | 0 0
  1. local TCS = game:GetService("TextChatService")
  2. local CS = game:GetService("Chat")
  3. local P = game:GetService("Players")
  4. local HS = game:GetService("HttpService")
  5. local MS = game:GetService("MessagingService")
  6. local RS = game:GetService("ReplicatedStorage")
  7. local SSS = script.Parent
  8. local EM = require(SSS.ServerEvent)
  9. local queue = {}
  10. local max = 25
  11. local function log(character, message)
  12.     local player = P:GetPlayerFromCharacter(character)
  13.     if player:FindFirstChild("DisplayPlayerName") and player.DisplayPlayerName.Value ~= "" then
  14.         local nickname = player:FindFirstChild("DisplayPlayerName").Value
  15.         table.insert(
  16.             queue,
  17.             player.Name .. " [@" .. nickname .. "] (" .. player.UserId .. "): ``" .. message.Text .. "``"
  18.         )
  19.     else
  20.         table.insert(queue, player.Name .. " (" .. player.UserId .. "): ``" .. message.Text .. "``")
  21.     end
  22.     if #queue >= max then
  23.         local outputstr = "Chat log for <t:"
  24.             .. DateTime.now().UnixTimestamp
  25.             .. ":f> ("
  26.             .. game.JobId
  27.             .. "/"
  28.             .. game.PrivateServerId
  29.             .. "):"
  30.         for k, v in ipairs(queue) do
  31.             outputstr = outputstr .. "\n" .. v
  32.         end
  33.         HS:PostAsync(
  34.             "yikes",
  35.             HS:JSONEncode({
  36.                 content = outputstr,
  37.             })
  38.         )
  39.         queue = {}
  40.     end
  41. end
  42. P.PlayerAdded:Connect(function(plr)
  43.     plr.Chatted:Connect(function(msg)
  44.         log(plr.Character, { Text = msg })
  45.     end)
  46. end)
  47. SSS.CMDInit.Events.forceChatlogSend.Event:Connect(function()
  48.     local outputstr = "Chat log for <t:"
  49.         .. DateTime.now().UnixTimestamp
  50.         .. ":f> ("
  51.         .. game.JobId
  52.         .. "/"
  53.         .. game.PrivateServerId
  54.         .. "):"
  55.     for k, v in ipairs(queue) do
  56.         outputstr = outputstr .. "\n" .. v
  57.     end
  58.     HS:PostAsync(
  59.         "yikes",
  60.         HS:JSONEncode({
  61.             content = outputstr,
  62.         })
  63.     )
  64.     queue = {}
  65. end)
  66. SSS.CMDInit.Events.changeChatlogLimit.Event:Connect(function(newlimit)
  67.     max = newlimit
  68. end)
  69. MS:SubscribeAsync("GCLDiscord", function(msg)
  70.     local sessiontitle = "KPMI"
  71.     local clr
  72.     local pmsg = msg.Data
  73.     local function parse()
  74.         if string.sub(pmsg, 1, 5) == "[/CLR" then
  75.             clr = "Color3|" .. string.split(string.split(pmsg, "[/CLR")[2], "]")[1]
  76.             local out = string.split(pmsg, "]")
  77.             table.remove(out, 1)
  78.             pmsg = table.concat(out, "]")
  79.         elseif string.sub(pmsg, 1, 4) == "[/DB" then
  80.             workspace.Events.BarrierEnabled.Value = false
  81.             -- wait for prim and his magic to make this work fully
  82.             pmsg = string.sub(pmsg, 6)
  83.         elseif string.sub(pmsg, 1, 4) == "[/EB" then
  84.             workspace.Events.BarrierEnabled.Value = true
  85.             -- wait for prim and his magic to make this work fully
  86.             pmsg = string.sub(pmsg, 6)
  87.         elseif string.sub(pmsg, 1, 3) == "[/B" then
  88.             task.spawn(function()
  89.                 EM.BlackoutEvent(tonumber(string.split(string.split(pmsg, "[/B")[2], "]")[1]))
  90.             end)
  91.             local out = string.split(pmsg, "]")
  92.             table.remove(out, 1)
  93.             pmsg = table.concat(out, "]")
  94.         elseif string.sub(pmsg, 1, 3) == "[/P" then
  95.             task.spawn(function()
  96.                 EM.PowerOutageEvent(tonumber(string.split(string.split(pmsg, "[/P")[2], "]")[1]))
  97.             end)
  98.             local out = string.split(pmsg, "]")
  99.             table.remove(out, 1)
  100.             pmsg = table.concat(out, "]")
  101.         elseif string.sub(pmsg, 1, 4) == "[/PU" then
  102.             task.spawn(function()
  103.                 EM.PurificationEvent()
  104.             end)
  105.             pmsg = string.sub(pmsg, 6)
  106.         elseif string.sub(pmsg, 1, 4) == "[/EX" then
  107.             task.spawn(function()
  108.                 EM.ExterminationEvent()
  109.             end)
  110.             pmsg = string.sub(pmsg, 6)
  111.         elseif string.sub(pmsg, 1, 3) == "[A|" then
  112.             RS.Remote.GCLMessage:FireAllClients(
  113.                 "[" .. sessiontitle .. "]: " .. string.split(string.split(pmsg, "[A|")[2], "]")[1],
  114.                 clr
  115.             )
  116.             local out = string.split(pmsg, "]")
  117.             table.remove(out, 1)
  118.             pmsg = table.concat(out, "]")
  119.         elseif string.sub(pmsg, 1, 4) == "[/DL" then
  120.             task.wait(tonumber(string.split(string.split(pmsg, "[/DL")[2], "]")[1]))
  121.             local out = string.split(pmsg, "]")
  122.             table.remove(out, 1)
  123.             pmsg = table.concat(out, "]")
  124.         elseif string.sub(pmsg, 1, 3) == "[T|" then
  125.             sessiontitle = string.split(string.split(pmsg, "[T|")[2], "]")[1]
  126.             local out = string.split(pmsg, "]")
  127.             table.remove(out, 1)
  128.             pmsg = table.concat(out, "]")
  129.         else
  130.             print("reached end condition")
  131.             return
  132.         end
  133.         print("continuing")
  134.         parse()
  135.     end
  136.     print("initializing")
  137.     parse()
  138.     if pmsg ~= "" then
  139.         print("attempting to send message")
  140.         RS.Remote.GCLMessage:FireAllClients("[" .. sessiontitle .. "]: " .. pmsg, clr)
  141.     end
  142. end)
Advertisement
Add Comment
Please, Sign In to add comment