I’ve been looking and trying to find a way how to do this. Everything I seem to do requires me to have permission level 4 or ROBLOX reverts the change after I rename it. (This is for admin commands so I don’t want to make a ui for the names.)
My Code:
_G.Name = function(char2, name, plr)
if plr == nil then
if game.Players:FindFirstChild(name.Name) then
local Character = name.Character
local Humanoid = Character.Humanoid
name.DisplayName = char2
end
return
end
if char2 == "all" then
for i,v in pairs(game.Players:GetChildren()) do
local Character = v.Character
local Humanoid = Character.Humanoid
pcall(function()
v.DisplayName = name
end)
end
return
end
if char2 == "others" then
for i,v in pairs(game.Players:GetChildren()) do
if v.Name ~= plr.Name then
local Character = v.Character
local Humanoid = Character.Humanoid
pcall(function()
v.DisplayName = name
end)
end
end
return
end
if char2 == "me" then
if game.Players:FindFirstChild(plr.Name) then
local Character = plr.Character
local Humanoid = Character.Humanoid
pcall(function()
plr.DisplayName = name
end)
end
return
end
for i,v in pairs(game.Players:GetChildren()) do
local vName = string.lower(v.Name)
if vName:sub(1, #char2) == char2 then -- 1 is where is starts, #char2 is how far to serch.
local Name = v.Name
local Character = v.Character
local Humanoid = Character.Humanoid
pcall(function()
v.DisplayName = name
end)
return
end
end
end
(The pcall function is there because of other scripts. It doesn’t mess it up btw.)
Any clues to my problem would help a-lot! Thanks. (Been at this for an hour .0. please help.)