I remade the deprecated Hint and Messages instances modern (NeoHint, NeoMessage)

helloooo i remade the Hint and Message instances using strictly typed Luau, and attempted to recreate them to look as close to the originals as i could. i also added support for styling them if you would rather change the look but keep the functionality. intended for server but the client can use them too

usage (NeoMessage)

local Message = require(path.to.NeoMessage, {Font = Enum.Font.Creepster}) -- different font
local MyMessage = Message.new("test")

task.wait(1)

MyMessage:SetText("I am the same message but different text")
print(MyMessage:GetText()) -- prints "I am the same message but different text"

task.wait(5)

MyMessage:Destroy()

usage (NeoHint):

local Hint = require(path.to.NeoHint, {BackgroundTransparency = 1}) -- makes bg invisible
local MyHint = Hint.new("test 2: electric boogaloo")

task.wait(1)

MyHint:SetText("Hey, I changed!")
print(MyHint:GetText()) -- prints "Hey, I changed!"

task.wait(5)

MyHint:Destroy()

i tried to keep the same “quirks” of the originals, such as messages disappearing when the text is empty, and hints not disappearing when empty.
styles are just dictionaries filled with TextLabel properties (since these are just TextLabels)

unfortunately couldn’t figure out a way to make it compatible with the Debris service, since these are custom objects

if you want to try them out, they’re currently on the toolbox

NeoMessage: https://create.roblox.com/store/asset/80379092499312/NeoMessage
NeoHint: https://create.roblox.com/store/asset/129737852036346/NeoHint

12 Likes
local Debris = game:GetService("Debris")

local duration = 10
local instance = Instance.new("TextLabel")

Debris:AddItem(instance, duration)

This should remove the message or hint after the duration

2 Likes

i know how Debris works, i might add that as a function but i’m not sure how i feel about baking it in as opposed to someone just using task.spawn(function() task.wait(5) MyHint:Destroy() end) especially since it would leave variables/connections possibly dangling, and also since it clones for each client

When an instance is deleted, it’s connections are cleaned up automatically. I’d suggest just taking in a separate argument and then running the task.spawn(function() task.wait(duration) MyHint:Destroy() end) from within the modulescript. That would clean up whatever code someone is using to run it from this:

local Hint = require(path.to.NeoHint) -- makes bg invisible
local MyHint = Hint.new("test 2: electric boogaloo")

task.wait(5)
MyHint:Destroy()

to this:

local Hint = require(path.to.NeoHint) -- makes bg invisible
local MyHint = Hint.new("hint text",5)
2 Likes

use task.delay(5,destroy,myhint)

I’m personally not very fond of this second parameter. It seems more like an anti-pattern, while the first example better matches the usual way you work with a Roblox Instance. Just wanted to share my thoughts on the matter; also this resource did a great job at capturing the old vibes @2048ping thank you for sharing it!

2 Likes

thank you! i agree, i don’t want a second parameter. maybe i could add function something like Hint:AddDebris(length), or Hint:DestroyIn(length)?

Why do you need a closure?

local Destroy = game.Destroy::(ins:Instance)->()
task.delay(1.5,Destroy,MyHint)

Is better+more optimized

2 Likes

true, this would be better, i forgot these existed :sob:

I think I posted that before
btw script type checking wont give you any performance boost. even that one millisecond

@2048ping wash your eyes

afaik it gives super tiny boost to bytecode compiler and its just better to have that to avoid passing banana into math function.

source? proof? benchmark? how it can “speed-up” the “bytecode compiler” just by telling that “a” is 100% a “number” (just by declaring it’s type) and not “any”?.. that doesn’t make any sense, let’s not go off topic there dude

1 Like

Typechecking code will improve produced bytecode in the future and more so it prevents you from passing wrong arguments into function.
Regardless even if it gives no perfomance if your code is not using --!strict mode its a good reason to consider it bad by 2025 standarts.

i just use it because i enjoy writing strict code more, and people seem to like it better so