Advertisement
Dark_Agent

Add-missing-2-UNC

Aug 10th, 2024
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | Fixit | 0 0
  1. --Origin https://scriptblox.com/script/Universal-Script-Basic-Functions-12707
  2. local dbg = {}
  3. function getcallingscript()
  4.  local s = debug.info(1, 's')
  5.  for i, v in next, game:GetDescendants() do
  6.   if v:GetFullName() == s then return v end
  7.  end
  8.  return nil
  9. end
  10. function dbg.getinfo(thread)
  11.  local CurrentLine = tonumber(debug.info(thread, 'l'))
  12.  local Source = debug.info(thread, 's')
  13.  local name = debug.info(thread, 'n')
  14.  local numparams, isvrg = debug.info(thread, 'a')
  15.  if #name == 0 then name = nil end
  16.  local a, b = debug.info(thread, 'a')
  17.  return {
  18.   ['currentline'] = CurrentLine,
  19.   ['Source'] = Source,
  20.   ['name'] = tostring(name),
  21.   ['numparams'] = tonumber(numparams),
  22.   ['is_vararg'] = isvrg and 1 or 0,
  23.   ['short_src'] = tostring(Source:sub(1, 60))
  24.   }
  25. end
  26. return dbg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement