Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ChatFloodDetector:
- -- Script GUID: {96d8105a-1e16-44a8-9798-797a494a2891}
- -- Decompiled with the Synapse X Luau decompiler.
- local v1 = require(game:GetService("Chat"):WaitForChild("ClientChatModules"):WaitForChild("ChatConstants"));
- local u1 = nil;
- pcall(function()
- u1 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
- end);
- if u1 == nil then
- u1 = {};
- end;
- if not u1.FormatMessageToSend or not u1.LocalizeFormattedMessage then
- function u1.FormatMessageToSend(p1, p2, p3)
- return p3;
- end;
- end;
- local u2 = {};
- local u3 = {};
- local function u4(p4)
- table.insert(p4, tick() + 15);
- end;
- return function(p5)
- p5:RegisterProcessCommandsFunction("flood_detection", function(p6, p7, p8)
- if u2[p6] then
- return false;
- end;
- local v2 = p5:GetSpeaker(p6);
- if not v2 then
- return false;
- end;
- if not v2:GetPlayer() then
- return false;
- end;
- if not u3[p6] then
- u3[p6] = {};
- end;
- if not u3[p6][p8] then
- u3[p6][p8] = {};
- end;
- local v3 = u3[p6][p8];
- local v4 = tick();
- while #v3 > 0 and v3[1] < v4 do
- table.remove(v3, 1);
- end;
- if #v3 < 7 then
- u4(v3);
- return false;
- end;
- local v5 = math.ceil(v3[1] - v4);
- if v5 > 1 then
- local v6 = "seconds";
- else
- v6 = "second";
- end;
- v2:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatFloodDetector_MessageDisplaySeconds", string.format("You must wait %d %s before sending another message!", v5, v6), "RBX_NUMBER", tostring(v5)), p8);
- return true;
- end, v1.LowPriority);
- p5.SpeakerRemoved:connect(function(p9)
- u3[p9] = nil;
- end);
- end;
- TeamChat:
- -- Script GUID: {fb4fac4f-1c47-4e6a-8aa7-ea22b4c54cd8}
- -- Decompiled with the Synapse X Luau decompiler.
- local l__ClientChatModules__1 = game:GetService("Chat"):WaitForChild("ClientChatModules");
- local v2 = require(l__ClientChatModules__1:WaitForChild("ChatSettings"));
- local v3 = require(l__ClientChatModules__1:WaitForChild("ChatConstants"));
- local u1 = nil;
- pcall(function()
- u1 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
- end);
- if u1 == nil then
- u1 = {};
- end;
- if not u1.FormatMessageToSend or not u1.LocalizeFormattedMessage then
- function u1.FormatMessageToSend(p1, p2, p3)
- return p3;
- end;
- end;
- local u2 = {
- ChatColor = v2.ErrorMessageTextColor or Color3.fromRGB(245, 50, 50)
- };
- return function(p4)
- local l__Players__4 = game:GetService("Players");
- local v5 = p4:AddChannel("Team");
- v5.WelcomeMessage = u1:FormatMessageToSend("GameChat_TeamChat_WelcomeMessage", "This is a private channel between you and your team members.");
- v5.Joinable = false;
- v5.Leavable = false;
- v5.AutoJoin = false;
- v5.Private = true;
- v5:RegisterProcessCommandsFunction("replication_function", function(p5, p6, p7)
- local v6 = p4:GetSpeaker(p5);
- local v7 = p4:GetChannel(p7);
- if v6 and v7 then
- local v8 = v6:GetPlayer();
- if v8 then
- for v9, v10 in pairs(v7:GetSpeakerList()) do
- local v11 = p4:GetSpeaker(v10);
- if v11 then
- local v12 = v11:GetPlayer();
- if v12 and v8.Team == v12.Team then
- v11:SendMessage(p6, p7, p5, {
- NameColor = v8.TeamColor.Color,
- ChatColor = v8.TeamColor.Color,
- ChannelColor = v8.TeamColor.Color
- });
- end;
- end;
- end;
- end;
- end;
- return true;
- end, v3.LowPriority);
- local function u3(p8, p9, p10)
- if p9 == nil then
- p9 = "";
- end;
- local v13 = p4:GetSpeaker(p8);
- if v13 then
- local v14 = v13:GetPlayer();
- if v14 then
- if v14.Team == nil then
- v13:SendSystemMessage(u1:FormatMessageToSend("GameChat_TeamChat_CannotTeamChatIfNotInTeam", "You cannot team chat if you are not on a team!"), p10, u2);
- return;
- end;
- local v15 = p4:GetChannel("Team");
- if v15 then
- if not v13:IsInChannel(v15.Name) then
- v13:JoinChannel(v15.Name);
- end;
- if p9 and string.len(p9) > 0 then
- v13:SayMessage(p9, v15.Name);
- end;
- v13:SetMainChannel(v15.Name);
- end;
- end;
- end;
- end;
- p4:RegisterProcessCommandsFunction("team_commands", function(p11, p12, p13)
- local v16 = false;
- if p12 == nil then
- error("Message is nil");
- end;
- if p13 == "Team" then
- return false;
- end;
- if string.sub(p12, 1, 6):lower() == "/team " or p12:lower() == "/team" then
- u3(p11, string.sub(p12, 7), p13);
- return true;
- end;
- if string.sub(p12, 1, 3):lower() == "/t " or p12:lower() == "/t" then
- u3(p11, string.sub(p12, 4), p13);
- return true;
- end;
- if string.sub(p12, 1, 2):lower() == "% " or p12:lower() == "%" then
- u3(p11, string.sub(p12, 3), p13);
- v16 = true;
- end;
- return v16;
- end, v3.StandardPriority);
- local function u4()
- if not v2.DefaultChannelNameColor then
- return Color3.fromRGB(35, 76, 142);
- end;
- return v2.DefaultChannelNameColor;
- end;
- local function u5(p14, p15)
- if p15.Neutral or p15.Team == nil then
- p14:UpdateChannelNameColor(v5.Name, u4());
- if p14:IsInChannel(v5.Name) then
- p14:LeaveChannel(v5.Name);
- return;
- end;
- elseif not p15.Neutral and p15.Team then
- p14:UpdateChannelNameColor(v5.Name, p15.Team.TeamColor.Color);
- if not p14:IsInChannel(v5.Name) then
- p14:JoinChannel(v5.Name);
- end;
- end;
- end;
- p4.SpeakerAdded:connect(function(p16)
- local v17 = p4:GetSpeaker(p16);
- if v17 then
- local v18 = v17:GetPlayer();
- if v18 then
- u5(v17, v18);
- end;
- end;
- end);
- local u6 = {};
- l__Players__4.PlayerAdded:connect(function(p17)
- u6[p17] = p17.Changed:connect(function(p18)
- local v19 = p4:GetSpeaker(p17.Name);
- if v19 then
- if p18 == "Neutral" then
- u5(v19, p17);
- return;
- end;
- if p18 == "Team" then
- u5(v19, p17);
- if v19:IsInChannel(v5.Name) then
- v19:SendSystemMessage(u1:FormatMessageToSend("GameChat_TeamChat_NowInTeam", string.format("You are now on the '%s' team.", p17.Team.Name), "RBX_NAME", p17.Team.Name), v5.Name);
- end;
- end;
- end;
- end);
- end);
- l__Players__4.PlayerRemoving:connect(function(p19)
- local v20 = u6[p19];
- if v20 then
- v20:Disconnect();
- end;
- u6[p19] = nil;
- end);
- end;
- ChatMessageValidator:
- -- Script GUID: {a395cd73-05c3-4577-99a3-a0f2a076a79d}
- -- Decompiled with the Synapse X Luau decompiler.
- local l__Chat__1 = game:GetService("Chat");
- local l__RunService__2 = game:GetService("RunService");
- local l__ClientChatModules__3 = l__Chat__1:WaitForChild("ClientChatModules");
- local v4 = require(l__ClientChatModules__3:WaitForChild("ChatSettings"));
- local v5 = require(l__ClientChatModules__3:WaitForChild("ChatConstants"));
- local u1 = nil;
- pcall(function()
- u1 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
- end);
- if u1 == nil then
- u1 = {};
- end;
- if not u1.FormatMessageToSend or not u1.LocalizeFormattedMessage then
- function u1.FormatMessageToSend(p1, p2, p3)
- return p3;
- end;
- end;
- local v6, v7 = pcall(function()
- return UserSettings():IsUserFeatureEnabled("UserChatAddServerSideChecks");
- end);
- local v8, v9 = pcall(function()
- return UserSettings():IsUserFeatureEnabled("UserChatValidateFirst");
- end);
- local v10 = { "\n", "\r", "\t", "\011", "\012" };
- if v4.DisallowedWhiteSpace then
- v10 = v4.DisallowedWhiteSpace;
- end;
- local function u2(p4)
- if l__RunService__2:IsStudio() then
- return true;
- end;
- local v11, v12 = pcall(function()
- return l__Chat__1:CanUserChatAsync(p4.UserId);
- end);
- return v11 or v12;
- end;
- local u3 = v6 or v7;
- local function u4(p5)
- if v4.MaximumMessageLength * 6 < p5:len() then
- return false;
- end;
- if utf8.len(p5) == nil then
- return false;
- end;
- if v4.MaximumMessageLength < utf8.len(utf8.nfcnormalize(p5)) then
- return false;
- end;
- return true;
- end;
- local u5 = v8 or v9;
- return function(p6)
- local v13 = nil;
- v13 = function(p7, p8, p9)
- local v14 = p6:GetSpeaker(p7);
- local v15 = v14:GetPlayer();
- if not v14 then
- return false;
- end;
- if not v15 then
- return false;
- end;
- if not l__RunService__2:IsStudio() and v15.UserId < 1 then
- return true;
- end;
- if not u2(v15) then
- v14:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatMessageValidator_SettingsError", "Your chat settings prevent you from sending messages."), p9);
- return true;
- end;
- if u3 then
- if not u4(p8) then
- v14:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatMessageValidator_MaxLengthError", "Your message exceeds the maximum message length."), p9);
- return true;
- end;
- for v16, v17 in pairs(v10) do
- if p8:find(v17) then
- v14:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatMessageValidator_WhitespaceError", "Your message contains whitespace that is not allowed."), p9);
- return true;
- end;
- end;
- else
- if v4.MaximumMessageLength + 1 < p8:len() then
- v14:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatMessageValidator_MaxLengthError", "Your message exceeds the maximum message length."), p9);
- return true;
- end;
- for v18 = 1, #v10 do
- if string.find(p8, v10[v18]) then
- v14:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatMessageValidator_WhitespaceError", "Your message contains whitespace that is not allowed."), p9);
- return true;
- end;
- end;
- end;
- return false;
- end;
- if u5 then
- p6:RegisterProcessCommandsFunction("message_validation", v13, v5.VeryHighPriority);
- return;
- end;
- p6:RegisterProcessCommandsFunction("message_validation", v13, v4.LowPriority);
- end;
- ChatCommandsTeller:
- -- Script GUID: {62984baf-530f-49e9-9d78-e75b20340494}
- -- Decompiled with the Synapse X Luau decompiler.
- local l__ClientChatModules__1 = game:GetService("Chat"):WaitForChild("ClientChatModules");
- local v2 = require(l__ClientChatModules__1:WaitForChild("ChatSettings"));
- local v3 = require(l__ClientChatModules__1:WaitForChild("ChatConstants"));
- local u1 = nil;
- pcall(function()
- u1 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
- end);
- if u1 == nil then
- u1 = {};
- end;
- if not u1.FormatMessageToSend or not u1.LocalizeFormattedMessage then
- function u1.FormatMessageToSend(p1, p2, p3)
- return p3;
- end;
- end;
- return function(p4)
- local function u2()
- if v2.ShowJoinAndLeaveHelpText == nil then
- return false;
- end;
- return v2.ShowJoinAndLeaveHelpText;
- end;
- p4:RegisterProcessCommandsFunction("chat_commands_inquiry", function(p5, p6, p7)
- if p6:lower() ~= "/?" and p6:lower() ~= "/help" then
- return false;
- end;
- local v4 = p4:GetSpeaker(p5);
- v4:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatCommandsTeller_Desc", "These are the basic chat commands."), p7);
- if v2.AllowMeCommand then
- v4:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatCommandsTeller_MeCommand", "/me <text> : roleplaying command for doing actions."), p7);
- end;
- v4:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatCommandsTeller_SwitchChannelCommand", "/c <channel> : switch channel menu tabs."), p7);
- if u2() then
- v4:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatCommandsTeller_JoinChannelCommand", "/join <channel> or /j <channel> : join channel."), p7);
- v4:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatCommandsTeller_LeaveChannelCommand", "/leave <channel> or /l <channel> : leave channel. (leaves current if none specified)"), p7);
- end;
- v4:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatCommandsTeller_WhisperCommand", "/whisper <speaker> or /w <speaker> : open private message channel with speaker."), p7);
- v4:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatCommandsTeller_MuteCommand", "/mute <speaker> : mute a speaker."), p7);
- v4:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatCommandsTeller_UnMuteCommand", "/unmute <speaker> : unmute a speaker."), p7);
- local v5 = v4:GetPlayer();
- if v5 and v5.Team then
- v4:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatCommandsTeller_TeamCommand", "/team <message> or /t <message> : send a team chat to players on your team."), p7);
- end;
- return true;
- end, v3.StandardPriority);
- if v2.GeneralChannelName then
- local v6 = p4:GetChannel(v2.GeneralChannelName);
- if v6 then
- v6.WelcomeMessage = u1:FormatMessageToSend("GameChat_ChatCommandsTeller_AllChannelWelcomeMessage", "Chat '/?' or '/help' for a list of chat commands.");
- end;
- end;
- end;
- FriendJoinNotifier:
- -- Script GUID: {83af296e-6626-4e60-a2e1-705a0a45ce55}
- -- Decompiled with the Synapse X Luau decompiler.
- local l__Players__1 = game:GetService("Players");
- local l__FriendService__2 = game:GetService("FriendService");
- local l__ClientChatModules__3 = game:GetService("Chat"):WaitForChild("ClientChatModules");
- local v4 = require(l__ClientChatModules__3:WaitForChild("ChatSettings"));
- local v5 = require(l__ClientChatModules__3:WaitForChild("ChatConstants"));
- local u1 = nil;
- pcall(function()
- u1 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
- end);
- if u1 == nil then
- u1 = {};
- end;
- if not u1.FormatMessageToSend or not u1.LocalizeFormattedMessage then
- function u1.FormatMessageToSend(p1, p2, p3)
- return p3;
- end;
- end;
- local u2 = {
- ChatColor = Color3.fromRGB(255, 255, 255)
- };
- return function(p4)
- local function u3(p5, p6)
- local v6 = p4:GetSpeaker(p5.Name);
- if v6 then
- v6:SendSystemMessage(u1:FormatMessageToSend("GameChat_FriendChatNotifier_JoinMessage", string.format("Your friend %s has joined the game.", p6.Name), "RBX_NAME", p6.Name), "System", u2);
- end;
- end;
- if (function()
- if v4.ShowFriendJoinNotification == nil then
- return false;
- end;
- return v4.ShowFriendJoinNotification;
- end)() then
- local function u4(p7, p8)
- if p7 ~= p8 then
- coroutine.wrap(function()
- if p7:IsFriendsWith(p8.UserId) then
- u3(p7, p8);
- end;
- end)();
- end;
- end;
- l__Players__1.PlayerAdded:connect(function(p9)
- local v7 = l__Players__1:GetPlayers();
- for v8 = 1, #v7 do
- u4(v7[v8], p9);
- end;
- end);
- end;
- end;
- MeCommand:
- -- Script GUID: {488260a1-1165-4e46-9c3f-b0f96301527d}
- -- Decompiled with the Synapse X Luau decompiler.
- local l__ClientChatModules__1 = game:GetService("Chat"):WaitForChild("ClientChatModules");
- local u1 = require(l__ClientChatModules__1:WaitForChild("ChatSettings"));
- local u2 = require(l__ClientChatModules__1:WaitForChild("ChatConstants"));
- return function(p1)
- if u1 and u1.AllowMeCommand then
- p1:RegisterFilterMessageFunction("me_command", function(p2, p3, p4)
- local l__Message__2 = p3.Message;
- if l__Message__2 and string.sub(l__Message__2, 1, 4):lower() == "/me " then
- p3.MessageType = u2.MessageTypeMeCommand;
- end;
- end);
- end;
- end;
- PrivateMessaging:
- -- Script GUID: {51d3b45f-6075-4504-a6d1-15d45b1b8729}
- -- Decompiled with the Synapse X Luau decompiler.
- local l__Chat__1 = game:GetService("Chat");
- local l__RunService__2 = game:GetService("RunService");
- local l__Players__3 = game:GetService("Players");
- local l__ClientChatModules__4 = l__Chat__1:WaitForChild("ClientChatModules");
- local v5 = require(l__ClientChatModules__4:WaitForChild("ChatConstants"));
- local v6 = require(l__ClientChatModules__4:WaitForChild("ChatSettings"));
- local u1 = nil;
- pcall(function()
- u1 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
- end);
- if u1 == nil then
- u1 = {};
- end;
- if not u1.FormatMessageToSend or not u1.LocalizeFormattedMessage then
- function u1.FormatMessageToSend(p1, p2, p3)
- return p3;
- end;
- end;
- local function u2()
- if not v5.WhisperChannelPrefix then
- return "To ";
- end;
- return v5.WhisperChannelPrefix;
- end;
- local u3 = {
- ChatColor = v6.ErrorMessageTextColor or Color3.fromRGB(245, 50, 50)
- };
- local function u4(p4)
- return u2() .. p4;
- end;
- return function(p5)
- local function u5(p6, p7)
- local v7 = nil;
- if l__RunService__2:IsStudio() then
- return true;
- end;
- local v8 = p6:GetPlayer();
- v7 = p7:GetPlayer();
- if not v8 or not v7 then
- return false;
- end;
- local v9, v10 = pcall(function()
- return l__Chat__1:CanUsersChatAsync(v8.UserId, v7.UserId);
- end);
- return v9 or v10;
- end;
- local function u6(p8, p9, p10)
- local v11 = nil;
- local v12 = p5:GetSpeaker(p8);
- local v13 = p9;
- local v14 = nil;
- if string.sub(p9, 1, 1) == "\"" then
- local v15 = string.find(p9, "\"", 2);
- if v15 then
- v13 = string.sub(p9, 2, v15 - 1);
- v14 = string.sub(p9, v15 + 2);
- end;
- else
- local v16 = string.match(p9, "^[^%s]+");
- if v16 then
- v13 = v16;
- v14 = string.sub(p9, string.len(v13) + 2);
- end;
- end;
- if v6.WhisperByDisplayName then
- local v17 = false;
- local v18 = {};
- for v19, v20 in pairs((l__Players__3:GetPlayers())) do
- if v20.Name == v13 then
- v17 = true;
- break;
- end;
- if v20.DisplayName == v13 then
- table.insert(v18, v20.Name);
- end;
- end;
- if not v17 and #v18 > 1 then
- local v21 = "";
- local v22, v23, v24 = pairs(v18);
- while true do
- local v25 = nil;
- local v26 = nil;
- v26, v25 = v22(v23, v24);
- if not v26 then
- break;
- end;
- v24 = v26;
- if v26 ~= #v18 then
- v21 = v21 .. "@" .. v25 .. ", ";
- else
- v21 = v21 .. "@" .. v25;
- end;
- end;
- v12:SendSystemMessage(u1:FormatMessageToSend("InGame.Chat.Response.DisplayNameMultipleMatches", "Warning: The following users have this display name: "), p10, u3);
- v12:SendSystemMessage(v21, p10, u3);
- return;
- end;
- end;
- v11 = p5:GetSpeaker(v13);
- local v27 = p5:GetChannel(u4(v13));
- if not v27 or not v11 then
- v12:SendSystemMessage(u1:FormatMessageToSend("GameChat_MuteSpeaker_SpeakerDoesNotExist", string.format("Speaker '%s' does not exist.", tostring(v13)), "RBX_NAME", tostring(v13)), p10, u3);
- return;
- end;
- if not u5(v12, v11) then
- v12:SendSystemMessage(u1:FormatMessageToSend("GameChat_PrivateMessaging_CannotChat", "You are not able to chat with this player."), p10, u3);
- return;
- end;
- if v27.Name == u4(p8) then
- v12:SendSystemMessage(u1:FormatMessageToSend("GameChat_PrivateMessaging_CannotWhisperToSelf", "You cannot whisper to yourself."), p10, u3);
- return;
- end;
- if not v12:IsInChannel(v27.Name) then
- v12:JoinChannel(v27.Name);
- end;
- if v14 and string.len(v14) > 0 then
- v12:SayMessage(v14, v27.Name);
- end;
- v12:SetMainChannel(v27.Name);
- end;
- p5:RegisterProcessCommandsFunction("whisper_commands", function(p11, p12, p13)
- local v28 = false;
- if string.sub(p12, 1, 3):lower() == "/w " then
- u6(p11, string.sub(p12, 4), p13);
- return true;
- end;
- if string.sub(p12, 1, 9):lower() == "/whisper " then
- u6(p11, string.sub(p12, 10), p13);
- v28 = true;
- end;
- return v28;
- end, v5.StandardPriority);
- local function u7()
- if not v6.WhisperChannelNameColor then
- return Color3.fromRGB(102, 14, 102);
- end;
- return v6.WhisperChannelNameColor;
- end;
- local function u8(p14, p15, p16)
- local v29 = p5:GetSpeaker(p14);
- local l__ExtraData__30 = v29.ExtraData;
- v29:SendMessage(p15, p16, p14, l__ExtraData__30);
- local v31 = p5:GetSpeaker(string.sub(p16, 4));
- local v32 = u4(p14);
- if v31 then
- if not v31:IsInChannel(v32) then
- v31:JoinChannel(v32);
- end;
- v31:SendMessage(p15, v32, p14, l__ExtraData__30);
- end;
- return true;
- end;
- local function u9(p17, p18, p19)
- if v5.MessageTypeWhisper then
- p18.MessageType = v5.MessageTypeWhisper;
- end;
- end;
- p5.SpeakerAdded:connect(function(p20)
- local v33 = p5:GetSpeaker(p20);
- if v6.PlayerDisplayNamesEnabled and v33:GetPlayer() then
- local v34 = v33:GetNameForDisplay() .. "(@" .. p20 .. ")";
- else
- v34 = p20;
- end;
- local v35 = u4(p20);
- if p5:GetChannel(v35) then
- p5:RemoveChannel(v35);
- end;
- local v36 = p5:AddChannel(v35);
- v36.Joinable = false;
- v36.Leavable = true;
- v36.AutoJoin = false;
- v36.Private = true;
- v36.WelcomeMessage = u1:FormatMessageToSend("GameChat_PrivateMessaging_NowChattingWith", "You are now privately chatting with " .. v34 .. ".", "RBX_NAME", tostring(v34));
- v36.ChannelNameColor = u7();
- v36:RegisterProcessCommandsFunction("replication_function", u8, v5.LowPriority);
- v36:RegisterFilterMessageFunction("message_type_function", u9);
- end);
- p5.SpeakerRemoved:connect(function(p21)
- local v37 = u4(p21);
- if p5:GetChannel(v37) then
- p5:RemoveChannel(v37);
- end;
- end);
- end;
- MuteSpeaker:
- -- Script GUID: {56bdc4bb-34bc-4f69-973c-c7a51ae3e296}
- -- Decompiled with the Synapse X Luau decompiler.
- local l__ClientChatModules__1 = game:GetService("Chat"):WaitForChild("ClientChatModules");
- local v2 = require(l__ClientChatModules__1:WaitForChild("ChatConstants"));
- local v3 = require(l__ClientChatModules__1:WaitForChild("ChatSettings"));
- local u1 = nil;
- pcall(function()
- u1 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
- end);
- if u1 == nil then
- u1 = {};
- end;
- if not u1.FormatMessageToSend or not u1.LocalizeFormattedMessage then
- function u1.FormatMessageToSend(p1, p2, p3)
- return p3;
- end;
- end;
- local u2 = {
- ChatColor = v3.ErrorMessageTextColor or Color3.fromRGB(245, 50, 50)
- };
- return function(p4)
- local function u3(p5)
- local v4 = nil;
- local v5 = nil;
- local v6 = p5;
- if string.sub(p5, 1, 1) == "\"" then
- v4 = string.find(p5, "\"", 2);
- if not v4 then
- v5 = v6;
- return v5;
- end;
- else
- local v7 = string.match(p5, "^[^%s]+");
- if v7 then
- v6 = v7;
- else
- v5 = v6;
- return v5;
- end;
- v5 = v6;
- return v5;
- end;
- return string.sub(p5, 2, v4 - 1);
- end;
- local function u4(p6, p7, p8)
- local v8 = u3(p7);
- local v9 = p4:GetSpeaker(p6);
- if v9 then
- local v10 = "";
- if v3.PlayerDisplayNamesEnabled then
- v10 = v9:GetNameForDisplay();
- end;
- if v8:lower() == p6:lower() or v3.PlayerDisplayNamesEnabled and v8:lower() == v10:lower() then
- v9:SendSystemMessage(u1:FormatMessageToSend("GameChat_DoMuteCommand_CannotMuteSelf", "You cannot mute yourself."), p8, u2);
- return;
- end;
- local v11 = v3.PlayerDisplayNamesEnabled and p4:GetSpeakerByUserOrDisplayName(v8) or p4:GetSpeaker(v8);
- if v11 then
- v9:AddMutedSpeaker(v11.Name);
- local v12 = v8;
- if v3.PlayerDisplayNamesEnabled then
- v12 = v11:GetNameForDisplay();
- end;
- v9:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatMain_SpeakerHasBeenMuted", string.format("Speaker '%s' has been muted.", v12), "RBX_NAME", v12), p8);
- return;
- else
- v9:SendSystemMessage(u1:FormatMessageToSend("GameChat_MuteSpeaker_SpeakerDoesNotExist", string.format("Speaker '%s' does not exist.", tostring(v8)), "RBX_NAME", tostring(v8)), p8, u2);
- end;
- end;
- end;
- local function u5(p9, p10, p11)
- local v13 = u3(p10);
- local v14 = p4:GetSpeaker(p9);
- if v14 then
- if v13:lower() == p9:lower() or v13:lower() == (v3.PlayerDisplayNamesEnabled and v14:GetNameForDisplay() or p9):lower() then
- v14:SendSystemMessage(u1:FormatMessageToSend("GameChat_DoMuteCommand_CannotMuteSelf", "You cannot mute yourself."), p11, u2);
- return;
- end;
- local v15 = v3.PlayerDisplayNamesEnabled and p4:GetSpeakerByUserOrDisplayName(v13) or p4:GetSpeaker(v13);
- if v15 then
- v14:RemoveMutedSpeaker(v15.Name);
- local v16 = v13;
- if v3.PlayerDisplayNamesEnabled then
- v16 = v15:GetNameForDisplay();
- end;
- v14:SendSystemMessage(u1:FormatMessageToSend("GameChat_ChatMain_SpeakerHasBeenUnMuted", string.format("Speaker '%s' has been unmuted.", v16), "RBX_NAME", v16), p11);
- return;
- else
- v14:SendSystemMessage(u1:FormatMessageToSend("GameChat_MuteSpeaker_SpeakerDoesNotExist", string.format("Speaker '%s' does not exist.", tostring(v13)), "RBX_NAME", tostring(v13)), p11, u2);
- end;
- end;
- end;
- p4:RegisterProcessCommandsFunction("mute_commands", function(p12, p13, p14)
- local v17 = false;
- if string.sub(p13, 1, 6):lower() == "/mute " then
- u4(p12, string.sub(p13, 7), p14);
- return true;
- end;
- if string.sub(p13, 1, 8):lower() == "/unmute " then
- u5(p12, string.sub(p13, 9), p14);
- v17 = true;
- end;
- return v17;
- end, v2.StandardPriority);
- end;
- ExtraDetalnitializer:
- -- Script GUID: {97d54f97-67fd-4dcb-b40a-815fd6c5256a}
- -- Decompiled with the Synapse X Luau decompiler.
- local u1 = {
- Groups = { {
- GroupId = 2868472,
- Rank = 100,
- ChatColor = Color3.new(0.6862745098039216, 0.8666666666666667, 1)
- }, {
- GroupId = 1200769,
- ChatColor = Color3.new(1, 0.8431372549019608, 0)
- } },
- Players = { {} }
- };
- local function u2(p1, p2)
- local v1 = true;
- if type(p2) ~= "nil" then
- v1 = type(p2) == "number";
- end;
- assert(v1, "requiredRank must be a number or nil");
- return function(p3)
- if not p3 or not p3.UserId then
- return false;
- end;
- local l__UserId__2 = p3.UserId;
- local u3 = false;
- local v3, v4 = pcall(function()
- if not p2 then
- u3 = p3:IsInGroup(p1);
- return;
- end;
- u3 = p2 < p3:GetRankInGroup(p1);
- end);
- if not v3 and v4 then
- print("Error checking in group: " .. v4);
- end;
- return false;
- end;
- end;
- (function()
- if u1.Groups then
- for v5, v6 in pairs(u1.Groups) do
- v6.IsInGroup = u2(v6.GroupId, v6.Rank);
- end;
- end;
- end)();
- local l__Players__4 = game:GetService("Players");
- local function u5(p4)
- local v7 = nil;
- local v8 = nil;
- local v9 = nil;
- local v10 = nil;
- local v11 = nil;
- local v12 = nil;
- if u1.Players then
- local v13 = l__Players__4:FindFirstChild(p4);
- if v13 then
- for v14, v15 in pairs(u1.Players) do
- if v13.UserId == v15.UserId then
- return v15.ChatColor;
- end;
- end;
- end;
- end;
- if u1.Groups then
- local v16, v17, v18 = pairs(u1.Groups);
- while true do
- local v19 = nil;
- v19, v7 = v16(v17, v18);
- if not v19 then
- break;
- end;
- v18 = v19;
- if v7.IsInGroup(l__Players__4:FindFirstChild(p4)) then
- v8 = "ChatColor";
- v9 = v7;
- v10 = v8;
- v11 = v9[v10];
- v12 = v11;
- return v12;
- end;
- end;
- return;
- else
- return;
- end;
- v8 = "ChatColor";
- v9 = v7;
- v10 = v8;
- v11 = v9[v10];
- v12 = v11;
- return v12;
- end;
- return function(p5)
- local u6 = { Color3.new(0.9921568627450981, 0.1607843137254902, 0.2627450980392157), Color3.new(0.00392156862745098, 0.6352941176470588, 1), Color3.new(0.00784313725490196, 0.7215686274509804, 0.3411764705882353), BrickColor.new("Bright violet").Color, BrickColor.new("Bright orange").Color, BrickColor.new("Bright yellow").Color, BrickColor.new("Light reddish violet").Color, BrickColor.new("Brick yellow").Color };
- local function u7(p6)
- local v20 = nil;
- v20 = 0;
- for v21 = 1, #p6 do
- local v22 = string.byte(string.sub(p6, v21, v21));
- local v23 = #p6 - v21 + 1;
- if #p6 % 2 == 1 then
- v23 = v23 - 1;
- end;
- if v23 % 4 >= 2 then
- v22 = -v22;
- end;
- v20 = v20 + v22;
- end;
- return local v24;
- end;
- local function u8(p7)
- return u6[(u7(p7) + 0) % #u6 + 1];
- end;
- local function u9(p8)
- local v25 = p8:GetPlayer();
- if v25 and v25.Team ~= nil then
- return v25.TeamColor.Color;
- end;
- return u8(p8.Name);
- end;
- local function v26(p9)
- local v27 = p5:GetSpeaker(p9);
- if not v27:GetExtraData("NameColor") then
- v27:SetExtraData("NameColor", u9(v27));
- end;
- if not v27:GetExtraData("ChatColor") then
- local v28 = u5(p9);
- if v28 then
- v27:SetExtraData("ChatColor", v28);
- end;
- end;
- if not v27:GetExtraData("Tags") then
- v27:SetExtraData("Tags", {});
- end;
- end;
- p5.SpeakerAdded:connect(v26);
- for v29, v30 in pairs(p5:GetSpeakerList()) do
- v26(v30);
- end;
- local u10 = {};
- l__Players__4.PlayerAdded:connect(function(p10)
- u10[p10] = p10.Changed:connect(function(p11)
- local v31 = p5:GetSpeaker(p10.Name);
- if v31 and (p11 == "TeamColor" or p11 == "Neutral" or p11 == "Team") then
- v31:SetExtraData("NameColor", u9(v31));
- end;
- end);
- end);
- l__Players__4.PlayerRemoving:connect(function(p12)
- local v32 = u10[p12];
- if v32 then
- v32:Disconnect();
- end;
- u10[p12] = nil;
- end);
- end;
- DisplayNameHelpers:
- -- Script GUID:
- -- Decompiled with the Synapse X Luau decompiler.
- local u1 = {
- ChattingToSelf = 1,
- NoMatches = 2,
- MultipleMatches = 3
- };
- local l__Players__2 = game:GetService("Players");
- local u3 = require(game:GetService("Chat"):WaitForChild("ClientChatModules"):WaitForChild("ChatSettings"));
- return {
- CommandErrorCodes = u1,
- getUserNameFromChattedName = function(p1, p2, p3)
- if p2 == p1 then
- return p2, u1.ChattingToSelf;
- end;
- local v1 = l__Players__2:GetPlayers();
- for v2, v3 in pairs(v1) do
- if string.lower(v3.Name) == string.lower(p1) then
- return v3.Name, nil;
- end;
- end;
- local v4 = 0;
- local v5 = nil;
- if u3.PlayerDisplayNamesEnabled then
- for v6, v7 in pairs(v1) do
- if v7.Name ~= p2 and string.lower(v7.DisplayName) == string.lower(p1) then
- v4 = v4 + 1;
- v5 = v7.Name;
- end;
- end;
- end;
- if v4 == 1 then
- return v5, nil;
- end;
- if v4 ~= 0 then
- if v4 >= 2 then
- return p1, u1.MultipleMatches;
- else
- return;
- end;
- end;
- if p3 == p1 then
- return p3, u1.ChattingToSelf;
- end;
- return p1, u1.NoMatches;
- end,
- getUsersWithDisplayNameString = function(p4, p5)
- local v8 = {};
- local v9 = "";
- for v10, v11 in pairs((l__Players__2:GetPlayers())) do
- if v11.Name ~= p5 and string.lower(v11.DisplayName) == string.lower(p4) then
- table.insert(v8, v11.Name);
- end;
- end;
- local v12, v13, v14 = pairs(v8);
- while true do
- local v15 = nil;
- local v16 = nil;
- v16, v15 = v12(v13, v14);
- if not v16 then
- break;
- end;
- v14 = v16;
- if v16 ~= #v8 then
- v9 = v9 .. "@" .. v15 .. ", ";
- else
- v9 = v9 .. "@" .. v15;
- end;
- end;
- return v9;
- end
- };
Advertisement
Add Comment
Please, Sign In to add comment