OH okay well that edit is reassuring. I will try that right now, if It doesn’t work I will just ping ya for more help !
you making this a bit more tough. I guess ill give you my script edited ofc.
cuz it took me a LONG time to make it and am not gonna give it full.
also remember this only works for horizontal textlabel so it would only work for 1 line.
its up to you to edit it NOT MINE. and it does NOT respect screen sizes
as it uses offset
local CustomEmoji = {}
local label
local images = {["bruh"] = 12312312312312}
local num = 0
local function addlabel(text,frame)
if text ~= "" then
local line = Instance.new("TextLabel",frame)
line.Name = num
num += 1
line.Size = UDim2.fromOffset(0,label.TextSize)
line.Font = require(game.ReplicatedStorage:WaitForChild("PieChat").Config).Font
line.TextSize = label.TextSize
line.TextColor3 = label.TextColor3
line.BackgroundTransparency = 1
line.AutomaticSize = Enum.AutomaticSize.X
line.Text = text
line.RichText = true
line.TextScaled = true
end
end
local function addimg(id,frame,isgif,tab)
local img = Instance.new("ImageLabel")
img.Name = num
num += 1
img.Size = UDim2.fromOffset(label.TextSize,label.TextSize)
img.Image = "rbxassetid://"..id
img.BackgroundTransparency = 1
img.Parent = frame
end
local function update(str)
if label:FindFirstChild("Line") then label.Line:Destroy() end
num = 0
for i,v in pairs(images) do
str = str:gsub(i,"★"..i:gsub(":","").."★")
end
local split = string.split(str,"★")
local frame = Instance.new("Frame",label)
frame.Name = "Line"
frame.AutomaticSize = Enum.AutomaticSize.Y
frame.BackgroundTransparency = 1
frame.Size = UDim2.fromOffset(label.TextBounds.X,label.TextBounds.Y)
local uilistlayout = Instance.new("UIListLayout",frame)
uilistlayout.FillDirection = Enum.FillDirection.Horizontal
uilistlayout.SortOrder = Enum.SortOrder.Name
for i,v in pairs(split) do
local imgg = nil
for ii,img in pairs(images) do
if v:lower() == string.gsub(ii,":","") then
imgg = img
break
end
end
if imgg then
addimg(imgg,frame)
else
addlabel(v,frame)
end
end
end
function CustomEmoji.Update(Label,Text)
label = Label
update(Text)
end
return CustomEmoji
-- Give me credits.
the full script is copyrighted as its very advance and uses GIFS. this is acctually for a chat system I am making called Pie Chat and when it releases all my scripts will be un copy righted. (If I release it to public ofc) you can sort of test it. its still in beta. doe
What do I write for the credits
Just say custom emoji made by me (kidsteve923) cuz i like credits :). Also you may think HOW TO USE IT?
I gotchu my guy
local CE = require() -- path to custom emoji module (CE = Custom Emojis)
local Label = script.Parent
local Text = "Whats up :bruh:"
CE.Update(Label,Text)
Thanks to that too man ! I was somewhat confused lol
OH BOY ITS WORKS!
AND Thanks to yo-
wait a minute…
suffering, :Waa:
Yea np people get confused with my messy scripts. And hopefully after seeing this NO ONE message me and say “work for me pwease”
can you show me the full umm what do you call it output
the full output minus the other scripts I used to this testing game :waa:
The code (just checking if they send msg bc yes)
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(c)
local lab = Instance.new('TextLabel')
lab.Parent = --their plrgui gui thingy eefhdjvmnhgdhf
require(game.ReplicatedStorage.EMOJI):Update(lab,'Whatsup :bruh:')
end)
end)
delete that line. its useless.
Well I mean it works like wow your a good scripter “Can I work for you” KIDDING KIDDING
So, thanks and what do you want me to put for the credits.
so I don’t feel bad for “scamming” you.
na just say custom emoji made my kidsteve923 I dont want anything else ;-; and put the credits if you want idc. And it does work right? I will make a better version soon doe.
Yeah, I just hope one day you can make it work for scaling due to my game being worked on for EVERY PLATFORM and my scripting capabilities is like a 2 year old trying to draw the mona lisa. It just ain’t happening
lmao yea probably. Cuz currently I have been very busy.
Dang, that kind of sucks. I haven’t slept for 5 days working on my game Anyways have a good day and we meet one day!
damn. Anyways yea gave a good day too.
You can use string.gsub() for replacing strings
I may be a little late to this but heres a tool i made that does this pretty well
--[[
UI Emoji Inserter
by upio (no attribution required)
Breakdown of what the script does (ignore this i used it to create this script):
- Create a frame to contain all the UI elements
- Add UIListLayout to frame and make it Wrappable & FillDirection = Horizontal
- Split all words in the text by spaces and get their size
- Create a new TextLabel for each word
- find if its a emoji and if so, add a new ImageLabel
]]
local TextService = game:GetService("TextService")
local TextTemplate = script.TextLabel
local Templates = {
["ImageLabel"] = {
BackgroundTransparency = 1,
}
}
local function New(ClassName: string, Options: {[string]: any})
local Instance = Instance.new(ClassName)
for Key, Value in pairs(Templates[ClassName] or {}) do
Instance[Key] = Value
end
for Key, Value in pairs(Options) do
if typeof(Value) == "table" then
local Object = New(Key, Value)
Object.Parent = Instance
continue
end
Instance[Key] = Value
end
return Instance
end
local function GetStringSize(string)
local Params = New("GetTextBoundsParams", {
Text = string,
Font = TextTemplate.FontFace,
Size = TextTemplate.TextSize,
Width = workspace.CurrentCamera.ViewportSize.X - 32,
})
local Bounds = TextService:GetTextBoundsAsync(Params)
Params:Destroy()
return Bounds.X, Bounds.Y
end
local UIEmojiInserter = {}
function UIEmojiInserter.init(Parent: Instance, Options: {
["Emojis"]: {[string]: {[string]: any}},
["SpaceSpacing"]: number?,
})
assert(Options.Emojis ~= nil, "Emoji table must be provided")
local SpaceSpacing = Options.SpaceSpacing or 2
local Helper = { UI = { StaticElements = {}, DynamicElements = {} } }
Helper.UI.StaticElements.ContainerFrame = New("Frame", {
BackgroundTransparency = 1,
Size = UDim2.fromScale(1, 1),
Position = UDim2.fromOffset(0, 0),
AnchorPoint = Vector2.new(0, 0),
BorderSizePixel = 0,
Parent = Parent,
["UIListLayout"] = {
FillDirection = Enum.FillDirection.Horizontal,
HorizontalAlignment = Enum.HorizontalAlignment.Left,
VerticalAlignment = Enum.VerticalAlignment.Center,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, SpaceSpacing),
Wraps = true,
}
})
function Helper:SetText(Text: string)
for _, Element in pairs(Helper.UI.DynamicElements) do
Element:Destroy()
end
Helper.UI.DynamicElements = {}
local Words = Text:split(" ")
local Cache = {
["Words"] = {}
}
for _, Word in pairs(Words) do
if not Cache.Words[Word] then
local EmojiMatch = Word:match(":(%w+):")
if EmojiMatch then
local Emoji = Options.Emojis[EmojiMatch]
if Emoji then
Cache.Words[Word] = New("ImageLabel", Emoji)
end
else
local SizeX, SizeY = GetStringSize(Word)
local WordLabel = New("TextLabel", {
Size = UDim2.fromOffset(SizeX, SizeY),
BackgroundTransparency = 1,
Text = Word,
Font = TextTemplate.Font,
FontFace = TextTemplate.FontFace,
TextSize = TextTemplate.TextSize,
TextColor3 = TextTemplate.TextColor3
})
Cache.Words[Word] = WordLabel
end
end
local WordLabel = Cache.Words[Word]:Clone()
WordLabel.Parent = Helper.UI.StaticElements.ContainerFrame
WordLabel.LayoutOrder = #Helper.UI.DynamicElements + 1
table.insert(Helper.UI.DynamicElements, WordLabel)
end
end
return Helper
end
local EmojiHelper = UIEmojiInserter.init(script.Parent, {
["Emojis"] = {
["Content"] = {
Image = "rbxassetid://135666356081915",
Size = UDim2.fromOffset(25, 25),
}
},
["SpaceSpacing"] = 2
})
EmojiHelper:SetText("Heh silly emoji inserter made by upio :Content: and it works with like yeah :Content:")
You need to put a textlabel that is the template text inside the script named “TextLabel”
Result:
How would this apply to chat? I know this could work with textboxes but chat?