Universal Script πŸ“Œ
1.6k Views
236 Executions

BEST NAME PROTECT | OPEN SRC | FOR VIDEO

Universal Script πŸ“Œ
bettusan
bettusanFirst script
10 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

A Name Protect script hides the local player’s real username on the screen by replacing it with a fake name for example, to create a video. It works client-side only, changing UI text like name tags or labels. The server and other players still see the real username. ChatGPT solution

View Raw
local CONFIG = {
    FakeName = "PROTECTED",      -- What to replace the username with
    FakeDisplay = "PROTECTED",   -- What to replace the DisplayName with
    MatchColor = true            -- Try to preserve formatting (useful for chat)
}

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local RunService = game:GetService("RunService")

-- Cache real names to avoid fetching them constantly
local RealName = LocalPlayer.Name
local RealDisplay = LocalPlayer.DisplayName

-- Function that instantly replaces text
local function SpoofText(obj)
    -- Check if the text actually contains the name to reduce load
    if not obj.Text:find(RealName) and not obj.Text:find(RealDisplay) then return end

    -- Temporarily disable the listener to avoid recursion (infinite loop)
    local originalText = obj.Text
    
    local newText = originalText:gsub(RealName, CONFIG.FakeName)
    newText = newText:gsub(RealDisplay, CONFIG.FakeDisplay)
    
    if originalText ~= newText then
        obj.Text = newText
    end
end

-- Function to process an object (attach "eyes" to it)
local function MonitorObject(obj)
    -- Work only with text elements
    if obj:IsA("TextLabel") or obj:IsA("TextButton") or obj:IsA("TextBox") then
        
        -- 1. Replace text immediately
        SpoofText(obj)

        -- 2. Attach an event: if the game tries to change the text back, replace it again
        obj:GetPropertyChangedSignal("Text"):Connect(function()


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
9.6k
70.7k
Bumped 36 minutes ago
Key System
Script hub
186.9k
1.9M
Bumped 2 hours ago
Key System

Script hub

#13 this week

Verified script badgeAirflow HUB

Script hub
602.2k
52.8k
Bumped 2 hours ago
Script hub
45.6k
11.1k
Bumped 4 hours ago
Key System
Paid

Script hub

#25 this month

Verified script badgeZekeHub - 58 Games, 1,300+ Features

Universal Script πŸ“Œ
53
236
Approved 4 hours ago