chat translator to english
Key RequiredUniversal

chat translator to english

Universal ScriptChatGPTChatGPT 640 views 478 executesUpdated Apr 14, 2026
0.0/ 5(3 votes)
030% Positive
Lua Script•58 lines (1921 chars)
-- Configuration
local TargetLanguage = "en" -- English
local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")

-- Function to handle the translation request
local function translateText(text)
    local url = string.format(
        "https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=%s&dt=t&q=%s",
        TargetLanguage,
        HttpService:UrlEncode(text)
    )

    -- Using the standard executor 'request' function
    local success, response = pcall(function()
        return request({
            Url = url,
            Method = "GET"
        })
    end)

    if success and response.StatusCode == 200 then
        local data = HttpService:JSONDecode(response.Body)
        if data and data[1] and data[1][1] then
            return data[1][1][1]
        end
    end
    return nil
end

-- Function to monitor players
local function monitorPlayer(player)
    if player == Players.LocalPlayer then return end
    
    player.Chatted:Connect(function(msg)
        local translated = translateText(msg)
        
        -- Only show if the translation is different from the original message
        if translated and translated:lower() ~= msg:lower() then
            print(string.format("[%s]: %s (Original: %s)", player.Name, translated, msg))
            
            -- Displaying in the system chat (Standard for executors)
            game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
                Text = string.format("[%s]: %s", player.Name, translated),
                Color = Color3.fromRGB(0, 255, 127), -- Spring Green
                Font = Enum.Font.SourceSansBold
            })
        end
    end)
end

-- Hook existing and new players
for _, player in ipairs(Players:GetPlayers()) do
    monitorPlayer(player)
end
Players.PlayerAdded:Connect(monitorPlayer)

print("Chat Translator Loaded: Language is set to English.")

Features & Information

a chat translator that I made with chatgpt without even testing the script cause im such a chud if there is any problems with the script unless you have a crappy executor let me know

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts