Open Source: Winky's Custom Chat

How would “player is typing” work in server with 50+ players (3+messages a sec)?

Text scaled is on for the typing thing, so it’d just be pretty small text. 3 people on the text label should be good.

I haven’t done that for this chat, but feel free to implement this yourself.

Would it be possible to have bubble chat enabled at the same time as this?

1 Like

Thank you for this! I have been making my own chat and it was an epic fail.

1 Like

I believe that it is possible.

I think that there is chat API that allows you to send bubble chat messages… so this may be something I add in the future.

it would also be interesting if it could sent to actual chat as well so you are able to run commands via chat, etc.

Looks great! I might modify it as I have had a bit of experience with modifying chat and I could put some of the icons I’ve made in Inkscape as general icons to use in my port.

Except there’s one problem… I want the /mute command to work for players and ideally the legacy /me command and I would also like compatibility with HD Admin but that’s not a big issue as the command bar exists.

1 Like

I think this is worse than the default chat in my opinion.

Here’s some problems with this:

  • Possibly the WORST part of this: Spamming the server with a typing event. This is absolutely terrible and I’m honestly shocked that you haven’t experienced serious server lag when using this system, I don’t even know how it works. I can only guess this is because you tested with just a baseplate on your local machine. This won’t hold up in any game. Why not just send an event to the server when they focused the textbox, and released focus?
  • Doesn’t resize messages based on text. Using a locked-size textbox and relying on TextScaled makes long messages look small and longer messages impossible to read, not to mention ugly. All messages should be the same size.
  • Doesn’t use the correct API for handling enter being pressed. You should use the LostFocus event and check that the enter pressed parameter is true. It also doesn’t check that this textbox is focused.
  • Uses another loop for some sort of typing animation.
  • Wrapping random functions in pcalls for seemingly no reason??
  • Spawning functions for seemingly no reason
  • Doesn’t show message feedback to the user until it’s sent through and back
  • manually shifts UI elements up. UIListLayout exists for a reason.

and minor complaints:

  • doesn’t use Roact. you should look into this
  • Doesn’t use the new TextService filtering API
  • you create lots of needless table variables for no reason, and also redefines variables that should be constants
  • the UI as it is, is frankly not that attractive, though this is subjective

You should not need any loops for a chat script. In fact, I can’t see a reason why you’d even need a Heartbeat connection either, though that would be preferable to your several loops.

I would highly recommend that you familiarize yourself with the Roblox API! Lots of your issues seem to be caused by you not realizing that events exist. I’m confident the Developer Hub will help you out a lot!

8 Likes

My custom chat was not made to be “better” than the default chat, but it was designed to change things up. Don’t use it if you want but it’s here if you want to. This was more of a learning experience on my part.

Just know that people like you are the reason that a lot of people don’t opensource looking for nothing but negatives in peoples works, and it’s kinda sad that you had nothing better to do than dissect a model looking for bad things and attempt to debunk someone trying to help other people on dvf. (:

Some responses…

Your most valid point. I was unaware that “spamming” remotes caused lag for the whole server (if this was true exploiters could crash any game on roblox…?), but in retrospect I can see how this was inefficient and this will be changed in a new version of the chat.

I’ve looked through every spawn that I used, and the only time this was being used was when there was a wait() in the script. If you didn’t know, wait yields the script, and spawn creates a separate thread, so instead of yielding the whole script, I created a separate thread for it. For example, the thread that waits 40 seconds before fading a message out is wrapped in a spawn so that the whole function does not yield and the script can continue.

I did this so that I can use tweening, if I used a list layout the inserting of new messages would be a cut and it would be jarring.

The main reason that I used TextScaled is because, correct me if I am wrong, TextSize is offset and not scale. So what may appear to be normal on a phone could be tiny on pc, vice-versa.

I did this because some of the functions were getting random errors, ones that occurred once in a hundred times but could crash the script so I just pcalled it.

My reason for pcalling in the server script is because exploiters can easily fire the chatting event with invalid arguments and crash the script.

Just being petty at this point.

What is roact?

Did not know there was one

If you’re talking about the configuration variables then these were created so that people with not a lot of knowledge with scripting can change things that they want to change without having to dive through the script.

Sorry for not being a UI designer?

What I think he actually means is the fonts just don’t look nice, Gotham is much more modern font. I don’t think he’s talking about positioning or icons but I could be wrong.

In the main script is a variable named “Configuration”…

Configuration.NameFont = Enum.Font.GothamBlack
Configuration.TextFont = Enum.Font.Cartoon

Exists… so why not just change the fonts if you don’t like them?

Hmm, maybe he didn’t use it and just looked at the script and the test video.

1 Like

Seems pretty irresponsible if you ask me.

One of the things that would be cool to see is maybe like a YT Super Chat system which would allows developers to allow donations when sending a chat message and that donation and chat message would be broadcast across the whole server. I could supply you with the donation icon which I’ll let you have for free but would usually be paid (teespring.com/cashicon, only would really lend to just get my name out there lol).

Like a robux donation? And there’s a separate chat for it or something?

Hmmm yeah maybe! Tabbed Chat is a thing so maybe you could have the ‘All’ messages tab, and the ‘Team’ and private messages tabs plus the ‘Donation’ tab you could develop. I think a Super Chat system could really help developers earn some money.

@Winky_y The user interface size needs a LOT of work.


Look how small it is? I can barely read. You should implement a system for text to expand across multiple lines. Also chat shouldn’t fade away after a while and I’d prefer to have a scrollbar in the chat.

Yeah even though it is worse than the default chat in my opinion it really adds some freshness to games.

2 Likes

I am well aware of how Lua works. Creating a thread every single time a chat message is made is bad. Knowledge of the Roblox API would help you here! For example, TweenService tweens have a delay argument. This would eradicate any need to create a new thread or yield at all.

You can still tween your messages with UIListLayout.

This is not how you use pcalls. You should have no errors whatsoever with a chat script, (especially not in the local portion) if you do, it is the result of a mistake in your code somewhere. The only case where pcalls are necessary are when using APIs that can fail, i.e. FilterStringAsync, and even in that case, you should be handling them, not simply wrapping functions in them, because what good does that do? All you have to do on the server is make sure that their message argument is a string, and maybe even throttle it, that’s it.

I think you should be much more concerned about spamming a remote to indicate whether they are typing or not. That will lag the server immediately. Like I said, the Roblox API reference will help you here. All you have to do is fire one event when they focus the textbox and one event when they unfocus.

This is irrelevant. For example, you shouldn’t redefine a TweenInfo every time a message isa created when it stays the same each time.

I’m not sure what you mean by this. Simply calculate the size of the new TextLabel based on the desired text size. Once again, Roblox API! Try TextService::GetTextSize()!

No, I didn’t use it. I can tell enough about how your script works just by looking at your code. My concern was not your font, but either way—No need to apologize! As I said, it’s just my opinion. Take it or leave it. I think sizing the text correctly would do wonders for your design.

This is just immaturity on your part. What do you mean people like me? I am giving you constructive criticism to help you get better. if you can’t or won’t take it, then close your post or don’t post at all.

There is no need to be so defensive. Beginners make mistakes all the time, and I provided you resources for most of the problems to try to fix it. Like I said, you should not need to use wait, or spawn, or coroutine in a chat script at all, let alone in most scripts—they are antipatterns.

edit:

I will agree, this was an unnecessary addition and I apologize. What I provided in the post should be enough to fix it, but I would suggest rescripting it.

4 Likes