WarnService — a new era of ROBLOX development

WarnService

A reimagined solution to warning text, and more.


API

This powerful resource grants developers an advanced, sophisticated API for scripts to interact with.

Uncover the magical API

WarnService.new(content: any): WarnLogger

Instantiates a brand new WarnLogger instance. Necessary for logging any sort of warning.

  • content: any - what will be logged as a warning

WarnLogger:Warn(): ()

Logs the desired warning. Acquired from content when the WarnLogger was created.

Since this is a fundamentally lightweight and simple module, I will be releasing the source here and now:

The painfully crafted source, which works perfectly
--!optimize 2

type WarnService = {
    new: (any) -> WarnLogger
}

type WarnLogger = {
    Warn: () -> ()
}

local WarnLogger = {}
WarnLogger.__index = WarnLogger

function WarnLogger.new(content: any): WarnLogger
    local self = {}
    self.Content = content
    return setmetatable(self, WarnLogger)
end

function WarnLogger:Warn(): ()
    warn(self.Content)
end

local WarnService = {}
WarnService.__index = WarnService

function WarnService.new(content: any): WarnLogger
    local warnLogger = WarnLogger.new(content)
    return warnLogger
end

return WarnService
4 Likes

I’m brought to tears; this is singlehandedly the most advanced module I’ve ever seen in my life; Now I can require a module instead of using a line of code! 10/10 :folded_hands:

4 Likes

My many tumultuous years on this platform has come to this.

WarnService: The end to an age-old question of how to easily use the warn function.

It’s a true testament to the developer community when scripts like these drop, for free no less, to assist newer scripters in optimizing and streamlining their code.

I’ve already migrated my projects over to this. I applaud the lightweight set-up, allowing me to save countless hours replacing all instances of warn.

I wish you many healthy years, you beautiful person.

I’ve been struggling with the complexity of warning this’ll be insanely useful THANK YOU SO MUCH

this looks extremely similar to my printservice, what’s up with that?

5 Likes

This is simply incredible. Severely underrated