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

Why does GetFullName() also get the parent of the name?

Asked by 7 years ago

-- Also when using the GetFullName() function, why does it get the parent of the instance too For example game:GetFullName() >>>>> game workspace:GetFullName() >>>>> game.workspace

Why does it also get the game, which is the parent, instead of only the name"workspace"

-- Is there a way of getting the name of the "workspace" without having the parent before? which in this case, is game

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

Instance:GetFullName() Get's the FULL path to the Instance.

Instance.Name gets the Name of the Instance.

Instance.Parent.Name gets the Instance's Parent name.

Examples:

local Model = Instance.new("Model",workspace)
local Part = Instance.new("Part",Model)

print(Part:GetFullName()) --> game.Workspace.Model.Part

print(Part.Name) --> Part

print(Part.Parent.Name) --> Model

print(Part.Parent.Parent.Name) --> Workspace

print(Part.Parent:GetFullName()) --> game.Workspace.Model

-Edit- Added examples to make answer more clear.

Ad

Answer this question