Advertisement
CeaselessSoul

Roblox GetFullName Replacement

Jun 27th, 2020
2,187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. local function GetFullName(instance)
  2.     if instance == game then
  3.         return game.Name
  4.     elseif instance.Parent == nil then
  5.         return instance.Name
  6.     else
  7.         local parent = instance
  8.         local fullName = ""
  9.  
  10.         while true do
  11.             if parent.Parent == game then
  12.                 fullName = parent.ClassName .. fullName
  13.                 return fullName
  14.             else
  15.                 local name = parent.Name
  16.  
  17.                 if name:match("[^%w_]") or tonumber(name:sub(1, 1)) then
  18.                     fullName = ("[%q]"):format(name) .. fullName
  19.                 elseif name == "" then
  20.                     fullName = "[\"\"]" .. fullName
  21.                 else
  22.                     fullName = (".%s"):format(name) .. fullName
  23.                 end
  24.             end
  25.  
  26.             parent = parent.Parent
  27.         end
  28.     end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement