Setting DisplayName in gaming via ServerScript

Hi gang, long time no post but I’ve come into a terrible situation where roblox won’t let me change a players displayname in the game and I cannot find any solutions. [it gives me the error of: not having access to WritePlayer???]

This is my script, any help would be appreciated (ive never had this issue before)

--// Group IDs
local RAF = x
local RAFR = y
local UK = z



game.Players.PlayerAdded:Connect(function(plr)
	if plr:IsInGroup(RAFR) and plr:IsInGroup(RAF) then
		plr.DisplayName="[RAFR] - ".. plr.Name
	elseif plr:IsInGroup(RAF) and not plr:IsInGroup(RAFR) then
		plr.DisplayName="[Royal Air Force] - "..plr.Name
	else if not plr:IsInGroup(RAFR) and not plr:IsInGroup(RAF) and not plr:IsInGroup(UK) then
			plr.DisplayName="[Citizen] - "..plr.Name
		end
	end
end)

shouldn’t you be changing the humanoid’s display name?

1 Like

oop mb, thank you :sob: i totally forgot about that-

we all make stupid mistakes dw

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.