task.spawn(function() -- betternameprotect -- part of Glovium getgenv().Replacement = getgenv().Replacement or "BetterNameProtect" getgenv().superstreamer = getgenv().superstreamer or false -- PLEASE enable ss if you want your name to be 100% protected local plr = game:GetService("Players").LocalPlayer local repl = getgenv().Replacement local name = plr.Name local disp = plr.DisplayName local name_pat = name:gsub("%W", "%%%1") local disp_pat = disp:gsub("%W", "%%%1") -- preload: terrible gui to mask the 1s delay before eveyrthing changes local gui = Instance.new("ScreenGui") gui.Parent = game:GetService("CoreGui") gui.IgnoreGuiInset = true gui.DisplayOrder = 2147483647 gui.ResetOnSpawn = false local frame = Instance.new("Frame") frame.BackgroundColor3 = Color3.fromRGB(0,0,0) frame.Size = UDim2.new(1,0,1,0) frame.BorderSizePixel = 0 frame.ZIndex = 2147483647 frame.Parent = gui -- 0. superstreamer task.spawn(function() local rs = game:GetService("RunService") while rs.RenderStepped:Wait() do if getgenv().superstreamer then local found = false for _, root in ipairs({game:GetService("CoreGui"), plr:FindFirstChild("PlayerGui")}) do if root and not found then for _, v in ipairs(root:GetDescendants()) do local c = v.ClassName if c == "TextLabel" or c == "TextButton" or c == "TextBox" then local ok, t = pcall(function() return v.Text end) if ok and t and (t:find(name, 1, true) or (disp ~= name and t:find(disp, 1, true))) then found = true break end end end end end gui.Enabled = found else gui.Enabled = false end end end) -- 1. init scan task.spawn(function() while task.wait(2) do for _, v in ipairs(game:GetDescendants()) do local c = v.ClassName if c == "TextLabel" or c == "TextButton" or c == "TextBox" then pcall(function() if v.Text:find(name, 1, true) then v.Text = v.Text:gsub(name_pat, repl) end if disp ~= name and v.Text:find(disp, 1, true) then v.Text = v.Text:gsub(disp_pat, repl) end end) end end end end) -- 2. catch new instances game.DescendantAdded:Connect(function(v) local c = v.ClassName if c == "TextLabel" or c == "TextButton" or c == "TextBox" then pcall(function() if v.Text:find(name, 1, true) then v.Text = v.Text:gsub(name_pat, repl) end if disp ~= name and v.Text:find(disp, 1, true) then v.Text = v.Text:gsub(disp_pat, repl) end end) end end) -- 3. hook text local mt = getrawmetatable(game) if mt then if setreadonly then setreadonly(mt, false) end local oldnew = mt.__newindex mt.__newindex = newcclosure(function(self, k, v) if k == "Text" and type(v) == "string" then if v:find(name, 1, true) then v = v:gsub(name_pat, repl) if getgenv().superstreamer then gui.Enabled = true end end if disp ~= name and v:find(disp, 1, true) then v = v:gsub(disp_pat, repl) if getgenv().superstreamer then gui.Enabled = true end end end return oldnew(self, k, v) end) if setreadonly then setreadonly(mt, true) end end -- 4. chat msgs local tcs = game:GetService("TextChatService") tcs.OnIncomingMessage = function(msg) if msg.Text:find(name, 1, true) or (disp ~= name and msg.Text:find(disp, 1, true)) then local p = Instance.new("TextChatMessageProperties") local t = msg.Text if t:find(name, 1, true) then t = t:gsub(name_pat, repl) end if disp ~= name and t:find(disp, 1, true) then t = t:gsub(disp_pat, repl) end p.Text = t return p end end print("bnp loaded. may take a while to replace.") end)