Emoji DisplayName Type System

I am trying to make an emoji system. overhead DisplayNames
Example: [EMOJI]DISPLAYNAME

I want it to be so I can add customEmojis and groupEmojis.
Example of what I mean by customEmojis:

local customEmojis = {
        ["USER"] = "EMOJI",
        ["USER2"] = "EMOJI"
}

can anyone explain and show a code example of how I would do something like this.

1 Like

A chat tag script I have made before, just replace the tags with whatever emoji you want.

local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))

local Tags = {
	["Officer"] = {GroupId = 13204448, RankIds = {40, 45},
	TagColor = Color3.fromRGB(245, 205, 48),
	TagName = "O",
	};
	["Developer"] = {GroupId = 13204448, RankIds = {50},
	TagColor = Color3.fromRGB(245, 177, 18),
	TagName = "DEV",
	};
	["Command"] = {GroupId = 13204448, RankIds = {60},
	TagColor = Color3.fromRGB(245, 177, 18),
	TagName = "HC",
	};
	["Commander"] = {GroupId = 13204448, RankIds = {255},
	TagColor = Color3.fromRGB(245, 177, 18),
	TagName = "COM",
	}
}

local function setTag(PlayerName, TagInfo, TagName)
	local Speaker = ChatService:GetSpeaker(PlayerName)
	
	if TagInfo.NameColor then
		Speaker:SetExtraData('NameColor', TagInfo.NameColor)
	end
	
	if TagInfo.MessageColor then
		Speaker:SetExtraData('ChatColor', TagInfo.MessageColor)
	end
	
	Speaker:SetExtraData('Tags', {{TagText = TagInfo.TagName or TagName, TagColor = TagInfo.TagColor}})
end

ChatService.SpeakerAdded:Connect(function(PlayerName)
	local Player = game:GetService("Players"):FindFirstChild(PlayerName)
	
	if not Player then
		warn("Player not found: " .. PlayerName)
		return
	end
	
	for TagName, TagInfo in pairs(Tags) do
		if TagInfo.GroupId and ((TagInfo.RankIds and table.find(TagInfo.RankIds, Player:GetRankInGroup(TagInfo.GroupId))) or (not TagInfo.RankIds and Player:IsInGroup(TagInfo.GroupId)))  then
			print("giving tag " .. TagName .. " to " .. PlayerName)
			setTag(PlayerName, TagInfo, TagName)
			
		else 
			print("Tag " .. TagName .. " not given to " .. PlayerName)
		end
	end
end)

Server-sided script, next time research how to do something before posting here please.

1 Like

What I mean is not chat system, what I meant was overhead displayName

1 Like
local customEmojis = {
        ["1"] = "EMOJI",
        ["2"] = "EMOJI"
}
game.Players.PlayedAdded:Connect(function(plr)
if customEmojis[plr.UserId] then
plr.CharacterAdded:Wait()
local char = plr.Character
local humanoid = char:WaitForChild("Humanoid")
humanoid.DisplayName = customEmojis[plr.UserId]
plr.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.DisplayName = customEmojis[plr.UserId]
end)
end
end)

try this maybe?? please tell me if it does not work.

1 Like

It didn’t work, but let me rephrase what I said and explain it a little better. what I am looking for is to make the DisplayName of the character look something like this:
image
and the emoji is the emoji set in the script

["USER"] = "THEEMOJI"

alr try this
please tell me if does not work

local customEmojis = {
	["2969205434"] = "😐",
	["2"] = "EMOJI"
}
game.Players.PlayedAdded:Connect(function(plr)
	if customEmojis[plr.UserId] then
		plr.CharacterAdded:Wait()
		local char = plr.Character
		local humanoid = char:WaitForChild("Humanoid")
		humanoid.DisplayName = "["..customEmojis[plr.UserId].."]"..humanoid.DisplayName
		plr.CharacterAdded:Connect(function(char)
			local humanoid = char:WaitForChild("Humanoid")
			humanoid.DisplayName = "["..customEmojis[plr.UserId].."]"..humanoid.DisplayName
		end)
	end
end)

Nope it seemed like it didn’t work

1 Like

hmm any errors because it was supposed to say [:neutral_face:] Duckity?

There was an error cus u misstyped PlayerAdded and accidently did PlayedAdded but I fixed that yet it still didn’t work

did u change anything because then it might not.

hmm mkay ill test in studio because im not in studio lol

my bad i also forgot that it was a number and not a string here is the fixed version sorry! should work if not tell me.

local customEmojis = {
	["2969205434"] = "😐",
	["2"] = "EMOJI"
}
game.Players.PlayerAdded:Connect(function(plr)
	if customEmojis[tostring(plr.UserId)] then
		plr.CharacterAdded:Wait()
		local char = plr.Character
		local humanoid = char:WaitForChild("Humanoid")
		local emoji = customEmojis[tostring(plr.UserId)]
		humanoid.DisplayName = "["..emoji.."]"..humanoid.DisplayName
		plr.CharacterAdded:Connect(function(char)
			local humanoid = char:WaitForChild("Humanoid")
			humanoid.DisplayName = "["..emoji.."]"..humanoid.DisplayName
		end)
	end
end)
1 Like

Thank you so much, for your help!

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