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()
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
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)
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!
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
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.