Uh, one issue; I’m actually looking for a registerMessageProcess for the client, one that changes the message for one client; if that’s possible?
Not currently a possibility without forking it, but I can likely add it in the next update. What’s your use-case and expected syntax examples?
Well my main use-case is to be able to manipulate the messages coming to the client; there is a feature in my roblox game where it’s basically a mental illness where you start hallucinating, and one of the features is you imagine people are saying something else.
For example, a player could say “Hi”, but the mental illness changes it to say “I’ll find you” in order to scare the player
The expected syntax is similar to .OnIncomingMessage to be able to manipulate the message, the chat color before it arrives to the client
I’d also love if there was a :DisplayBubble feature!
1.1.1
- Added custom emojis (you heard me) (to enable them, you’ll need to add the new configurations, you can find it by reinserting the loader)
- Loads of new API features
- Other features I definitely forgot
no option to manually set chat tags? at least i couldnt find one
nevermind i just found it (keystrokes)
I was wondering, is there any way to make a speaker in a client plugin? I want to send a message to the client, but right now it seems we can only send system messages which I don’t know how to customize the name or icon of.
Edit: I made a hacky function that lets me send messages as any speaker from a client plugin
local function sendMessageAsSpeaker(params)
local text = params.text or ""
local name = params.name or "System"
local nameColor = params.nameColor or Color3.new(1, 1, 1)
local icon = params.icon or nil
local tag = params.tag or nil
local tagColor = params.tagColor or Color3.new(1, 1, 1)
api:systemMessage(".")
for _, message in game.Players.LocalPlayer.PlayerGui:WaitForChild("Chat"):WaitForChild("Container"):WaitForChild("ChatWindow"):WaitForChild("Main"):WaitForChild("Scroller"):WaitForChild("MessageContainer"):GetChildren() do
if message ~= nil and message:IsA("Frame") then
if message:FindFirstChild("Raw") ~= nil then
if message.Raw.Text == `<font color="rgb(200,200,200)">System:</font> .` then
if icon ~= nil and icon ~= "" then
message.Icon.Image = icon
message.Icon.Visible = true
message.Raw.Size = UDim2.new(1, -20, 0, 16)
end
local formattedTag = tag and tag ~= "" and string.format('<font color="rgb(%d,%d,%d)">[%s] </font>', tagColor.R * 255, tagColor.G * 255, tagColor.B * 255, tag) or ""
local formattedName = string.format('<font color="rgb(%d,%d,%d)">%s:</font>', nameColor.R * 255, nameColor.G * 255, nameColor.B * 255, name)
message.Raw.Text = formattedTag .. formattedName .. " " .. text
end
end
end
end
end
-- Example calls
sendMessageAsSpeaker({
text = string.format("Welcome to BS:O, %s!", game.Players.LocalPlayer.DisplayName),
name = "Game",
nameColor = Color3.new(1, 0.717647, 0.772549),
icon = "rbxassetid://18556164970"
})
sendMessageAsSpeaker({
text = string.format("Welcome to BS:O, %s!", game.Players.LocalPlayer.DisplayName),
name = "Game",
nameColor = Color3.new(1, 0.717647, 0.772549)
})
Would you ever make this compatible with using Admin commands such as HDAdmin or Adonis?
This is an amazing chat system, but i have a few problems,
Custom emoji placement is not working very well for me (using MontserratBlack font)
Also it is hitting datastore limits even after I set SaveData.Enabled
to be false
The bubble chats are also not going away, and I got another players chats above my head
That’s very odd, I’m sorry about the problems. I am currently away from my laptop, and unable to fix these right now. I don’t know what could be causing the bubble chat problems, let me look.
Can you provide a way to reproduce the bubble chat appearing on another player?
Hey, if I may ask, how did you do this? Did you do it by using a horizontal UIListLayout with 0 padding and adding the text before the emoji, then a imagelabel with the emoji then rest of text or?
If that’s the method you used, then great, I know that I definitely have a actual maybe working method.
But yeah, amazing work on this library.
Oh my god, why didn’t I think of that, you’re a genius
I right now have an over-complicated system that calculates where the text is wrapped so I can identify lines, (accounting for rich text), then it will find each position where the emojis should be based on the text size and place them down.
You can find it at the github called ‘LineDetector’ DevForum refuses to let me post the link.
though id say be careful because i frankly dont know the side effects of horizontal uilistlayout used in that manner, might be a little annoying to work with if the Wraps value doesnt work correctly.
cuz well, didn’t test it at all.
It still does have a level of complexity with rich text, because Roblox wraps lines in a way that follows this flow:
→ Split by whitespace (spaces, etc)
→ Loop through the words, if it is supposed to wrap, it:
→ If the word X size is bigger than the X of the parent label, it’ll split the word halfway through or so, else it will push the whole word to the next line
But this is annoying to calculate with RichText and I have to use workarounds for this.
I have gotten your idea to work quite well thank you
With richtext if you need to get textbounds you can use another UI object as a “simulator” or just the new richtext parameter in gettextboundsparams which was added in release 634.
thats if you meant textbounds, size, etc.
Of course they add that after I destroy my braincells creating a workaround
Currently, I have a proxy label (as you mentioned) with AutomaticSize set to AutomaticSizeX and I add letter-by-letter with rich text and detect the AbsoluteSize
1.1.2
- Fixed custom emojis and bubble chat (for @PRIC3L3SS) (thanks to @RabbyDevs idea for implementation)
- Fixed crashing bug when a user leaves
- Added a message caching system to be a little more friendly on memory
One question, why is all the UI loaded in via modules, not just a specific screen UI so that it is user-friendly to edit? I’ve sat here for nearly 2 hours now trying to edit the UI, as simple as it sounds it is so hard to do.
I’m sorry! It was because it made it easier for me to be able to port into GitHub and make open-source. If you’d like it to be a screen-UI you can select it in the explorer and run this in the command bar:
local module = game:GetService("Selection"):Get()[1]
local ui = require(module)()
ui.Parent = module
module.Source = [[
return function()
return script:WaitForChild("Chat")
end
]]
I personally use this when I make UI modifications, and it works well.
Is there a way to use the custom bubble chat for NPCs? I use TextChatService for them at the moment and it still works even with it disabled yet it looks nowhere near as good as the player’s bubble chat, and is very noticeable.