Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Out of curiosity. Why can't we alter a player's name under the 'Players' folder?

I was messing around a little to brush up on my knowledge of lua and compiled the script shown below. When I ran the script, it displayed an error in the output (also shown below).

game.Players.PlayerAdded:connect(function(player)
	if player.Name == "ROBLOX" then
		print("ROBLOX is here!")
	elseif player.Name ~= "ROBLOX" then
		local players = game.Players:GetChildren()
		for _, plr in pairs(players) do
			plr.Name = "ROBLOX"
		end
		wait()
		if game.Players:FindFirstChild("ROBLOX") then
			print("ROBLOX is here!")
		end
	end
end)

The output states the following: 04:01:07.034 - The current identity (2) cannot set a Player's name (lacking permission 4)

What does this mean? Why do we not have the permission to change the player's name? Has this ever been done before?

3 answers

✓ Accepted answer

Roblox studio users lack the permissions to edit the player names because then that would load the character's personal avatar, BC/TBC/OBC status, and you would be using their account to play in the game. This could alter their status in the game (such as leaderstats) and if you perform abusive behavior, the owner of that user would be in trouble for nothing they have done.

You just aren't allowed, I have no idea why, it's probably because the server instance is coded to work this way and renaming a player to another player's name might make the server load the other player's stuff? Or maybe nothing would happen at all but they decided to not allow this to prevent exploiters or something, idk.

If you want to change a player's ID, there are ways to do that.

2 comments

0

Hm interesting.

0

Lolno

Well, the Player's name is set to readonly by default, meaning you can't edit or change it in any way.

This discussion is preserved as it was. New answers, comments, and votes are closed.