Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to print the full location of a Script/Part?

Asked by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Say if I have a script within a Part, that's in workspace, the script would print: "Workspace>Part>Script". I know how to use concatenation to print that, but I can't figure out how to make the script keep going up a Parent, without causing an error. Any tips?

0
I've tried setting up a function, that would keep adding the Parent's name to a Table, if the name isn't "Place2", but it would always overflow for some reason. I can't provide the script, since the overflow crashed my studio. Shawnyg 4330 — 9y

1 answer

Log in to vote
1
Answered by
iaz3 190
9 years ago

You are looking for the GetFullName method

Example:

print(workspace.Camera:GetFullName())
-- returns: Workspace.Camera
1
Thank you very much! I can't believe that I've overlooked that! Shawnyg 4330 — 9y
1
Would you happen to know how to highlight the part in exlorer? Shawnyg 4330 — 9y
0
You mean a selection box..... lucas4114 607 — 9y
0
Yes, i do know. the Selection Service(http://wiki.roblox.com/index.php?title=API:Class/Selection) only in studio/edit i believe, though. iaz3 190 — 9y
View all comments (2 more)
0
@Lucas, No, in studio, how an object would be highlighted in the Explorer. @Iaz, Thanks, but that's not what I was looking for Shawnyg 4330 — 9y
0
you can set the selection using it, it shows how in the examples iaz3 190 — 9y
Ad

Answer this question