How to change the Display name of the player?

I was trying to make it so that when someone typed into a text box it would change the players display name to whatever they wrote.

My code:

script.Parent.Text:GetPropertyChangedSignal()
    player = game:GetSevice(“players”)
    for i, player in pairs(players, GetPlayers()) do
        local plr = player:WaitForChild(“Humanoid”)
        plr.DisplayName = script.Parent.Text
    end
end)

I guss you have to make custom title and make it changeable like the owner display title and make it accessible from the text box

I believe a player’s display name is a locked property, so you cannot change it. Instead, you could make custom nametags for your game.

You should probably make a custom name tag system for this. And there are so many errors in your script

You never binded the function, nor defined which property will be changed.

script.Parent.Text:GetPropertyChangedSignal(“Text”):Connect(function()

Local variables, please!! Also GetService is spelled incorrectly, and make sure to realize that things are case-sensitive in lua

local players = game:GetService(“Players”)

: not ,

players:GetPlayers()
1 Like

you are playing with fire

remember to add filter string!!!