I recently had some issues with debugs as I would have to CONSTANTLY create different debug messages. I got tired of that so I made a simple library to ease up my pain. It has a couple of functions in it so Ill list them
getcLine()
local test = Debug:getcLine() --Gets the line calling the function
getsName()
local test = Debug:getsName() --Gets the script calling the function
getfName()
local test = Debug:getfName() --Gets the function calling the function
Also, if you call the module as a function, it prints this
Debug called on line X in script: <name>
Here is an example of the module in use:
local Debug = require(game.ReplicatedStorage:WaitForChild("Debug"))
function test()
Debug()--prints Debug called on line 4 in script: <name>
print(Debug:getcLine()) --prints 5
Debug()--prints Debug called on line 6 in script: <name>
print(Debug:getsName()) --prints script name
Debug()--prints Debug called on line 7 in script: <name>
print(Debug:getfName()) --prints test
end
test()
I am sorry if this script/service is too simple. This is my first release of anything on the forum
Module link:
–edit, thanks for telling me about the spelling errors