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

Most efficient way to get a script's path to workspace?

Asked by 9 years ago

So, I created a certain module I plan to release to the public for a model of mine. They would put this module in a flag. I want the module to get its path from workspace. For example, if the module was in a model, inside a model, I would want it to return script.Parent.Parent.Parent or something like that. How would I do this?

1 answer

Log in to vote
0
Answered by
funyun 958 Moderation Voter
9 years ago

If you want a string of the object's path in the hierarchy, you use the GetFullName() method.

print(script:GetFullName())
1
Thank you very much! antonio6643 426 — 9y
Ad

Answer this question