Instance path retriever

Path retriever plugin

Source code
Plugin


Disclaimer
Path retriever is a plugin very similar to @UltChowsk’s plugin called Get object path. I drew almost all of my inspiration from their plugin. Please go check their plugin out as this idea was not original.

What is it?
Path retriever is a plugin that prints selected instance’s path’s in the output. It also has the ability to print the paths of an instance’s children, descendants and includes the ability to add WaitForChild() or FindFirstChild() to the path.


Why not use Instace:GetFullName()
This function doesn’t include support for

  1. Services such as ReplicatedStorage
  2. Instances named with numbers
  3. Instances with multiple words in their name.
  4. You cannot choose to add the functions FindFirstChild() for WaitForChild()

Note: Not including support means when defining instance as variable it will cause an error

Example of differences

For this example, I am going to reference a part called “Kill brick” under another instance called 2.

What function prints

ServerScriptService.2.Kill brick

What my plugin prints

game.ServerScriptService["2"]["Kill brick"]

or

game.ServerScriptService:WaitForChild("2"):WaitForChild("Kill brick")

or

game.ServerScriptService["2"]:FindFirstChild("Kill brick")

What is the difference between the two plugins?
There aren’t many differences between the two plugins however my plugin

  1. Can retrieve the selected instance’s descendant’s or children’s path
  2. Doesn’t include game:GetService("") when referencing services but rather game.(Service here)
  3. Can include the functions WaitForChild("") or FindFirstChild("") Useful for local scripts

Why is WaitForChild() or FindFirstChild() needed?
The reason that the plugin supports these prefixes, is because wait for child is needed when looking at instances on local scripts as they are not always replicated. Find first child may also be needed when checking if a part exists or if there is more than one instance with this name.


Final notes
The change from game:GetService() to game.(service) was because it allows for auto-filling.

This plugin is my first and it also supports instances named with multiple words and the source code is available in a Pastebin(linked at the top of the page). Feel free to pm me or reply if you have any questions or feedback.


Changelog

Version 1
  • Created plugin, has support for numbers, multiple words and retrieving descendants.
Version 1.1
  • Numbers contain quotation marks around them
Version 1.2
  • UI design changed
    image

  • Added functions WaitForChild() and FindFirstChild() in path

  • Added ability to get Children’s paths

Version 1.3
  • Added ability to select descendants of a selected instance
Version 1.4
  • Fixed typo when surrounding numbers with brackets
2 Likes

cool plugin
here’s a command bar command that does something similar

print(game.Selection:Get()[1]:GetFullName())
4 Likes

Like dispeller mentioned, this is very similar to a built-in function. What advantages does this have to GetFullName?

2 Likes

Isn’t this more of a disadvantage? Some services need GetService to be created if not made (ie. Teams) and RunService under the DataModel is named Run Service.

P.S: The source of the plugin should be in a Pastebin / GitHub Repo rather than a script; mobile users cannot view it.

The advantages my plugin has over these is that my one supports services, numbers and instance names with multiple words.

If you use that command on a service with an instance called test inside of it it will print

ServerScriptService.Test

However with my plugin it adds game. to the start of that to make the path not error when referencing it. Printing

game.ServerScriptService.Test

That function also doesn’t surround numbers and names with multiple words with square brackets which causes the path to error.

Example of differences

For this example I am going to reference a part called “Kill brick” under another instance called 2.

What command line prints

ServerScriptService.2.Kill brick

What my plugin prints

game.ServerScriptService[2]["Kill brick"]

This causes an error when setting these instances as variables

1 Like

Thanks for your tip with the pastebin I’ll make one now. Also, with game:GetService() why would you need to require an instance in an uncreated service as you need to be able to select the object under the instance. I can make this an option to toggle on and off however.

Readability reasons perhaps.

Sorry, I don’t understand what you mean by readability. If you are talking about adding game:GetService() to make the path easier to read. The main reason why I did not include it is because it does not auto fill when you are adding more text to it.

Example
So, say you’re defining a variable of a path and you just added an instance called “Wall2” under it. If you type in w it will auto fill wall2 for you but if you use game:GetService() it will not.

Also, I say this may not be needed as if the service has not been created you cannot select an instance under which is how the plugin knows what to print.

Thank you for the feedback :grinning:

You’re going to be copy-pasting the path into the script anyway; so I don’t think this is a strong argument.

If you decide to add more to the path later on maybe halfway through your script it might be necessary however, it may not. When I’m usually writing my scripts I define instance variables at the start and later on I may need to call an object under it but because I’ve already defined it, I don’t need to find the whole path again which would make my scripts longer.

Funnily enough, I actually added in number support today after I realized that the given path didn’t work in one of my scripts. I also removed the triple right-click because I was testing it and realized it was not that intuitive, but got lazy and did not get around to disabling it until now.

I do like your version of this though.

1 Like

Should it not be:

game.ServerScriptService["2"]["Kill brick"]

I’ve found that it’s not necessary to put quotation marks around numbers

Well:

game.Players:GetPlayers()[1]

is not the same as:

game.Players:GetPlayers()["1"]

[1] without quotation marks indexes the first object in an array, whereas ["1"] would index a child named “1”. But I could be wrong-?

Hahaha what a coincidence, now the only real difference is that my one can get descendants so it kinda seems like mine is pointless but it was fun making it anyway. Just want to add that your plug-in has helped so much though so thanks for that :smile:

1 Like

I’ll have a look at that in a bit I’m currently on mobile but I’ll change it just in case, I’m also thinking of adding an option where it adds wait for child For each new path just for ease when dealing with local scripts, replicated storage and play GUIs.

Numbers are now surrounded with quotation marks. I have updated the plugin and source code.