-- Отправляет "/e dance3" в чат (новый и старый чат)
local TextChatService = game:GetService("TextChatService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local function sendChat(msg)
-- Новый чат
if TextChatService.ChatVersion == Enum.ChatVersion.TextChatService then
local success = false
pcall(function()
local cfg = TextChatService:FindFirstChildOfClass("ChatInputBarConfiguration")
local channel = cfg and cfg.TargetTextChannel
if not channel then
local tc = TextChatService:FindFirstChild("TextChannels")
channel = (tc and (tc:FindFirstChild("RBXGeneral") or tc:FindFirstChildWhichIsA("TextChannel"))) or TextChatService:FindFirstChildOfClass("TextChannel")
end
if channel then
channel:SendAsync(msg)
success = true
end
end)
if success then return true end
end
-- Старый чат
local events = ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents")
if events and events:FindFirstChild("SayMessageRequest") then
events.SayMessageRequest:FireServer(msg, "All")
return true
end
warn("Не удалось отправить сообщение: возможно, в игре кастомный чат.")
return false
end
task.delay(0.5, function()
sendChat("/e dance3")
end)