I'm developing a plugin that counts the lines in each and every script in a game, but I don't know how to detect a new line. Here's the main code so far:
function getLines()
local count=0
local objectsInGame={Workspace,game.Players,game.Lighting,game.ReplicatedFirst,game.ReplicatedStorage,game.ServerScriptService,game.ServerStorage,game.StarterGui,game.StarterPack,game.StarterPlayer,game.Soundscape,game.HttpService}
for subject=1,#objectsInGame do
for _,v in pairs(objectsInGame[subject]:GetChildren()) do
if v:IsA("Script") or v:IsA("LocalScript") or v:IsA("ModuleScript") then
print("Was a script")
local source=v.Source
--add to line count
end
end
end
return count
end
There are no errors, all of it works fully.

1 comment
Cool, that's exactly what I needed! Thanks a lot!