Hello, I like to learn scripting from looking at other scripts. I see that a line of code says val.Name = script.Parent.Parent.Parent.Name. The script is in one thing under lighting. Like this:
LIGHTING: GUI(Under Lighting) script(Under GUI)
So the script.Parent.Parent.Parent.Name would not be possible because the last Parent would make it the game as the parent. So how is "Name" under the game? It is a Interview GUI in Lighting. But if the script is under an object in Lighting, how is the third parent possible to work and how is Name work if the parent would be game?
script.Parent.Frame:TweenSizeAndPosition(UDim2.new(0, 300, 0, 110), UDim2.new(0.5, -150, 0.5, -55)) function close() script.Parent.Frame:TweenSizeAndPosition(UDim2.new(0, 0, 0, 0), UDim2.new(0.5, 0, 0.5, 0)) wait(1) script.Parent:Destroy() end function yes() if game.ServerStorage.Interviewing.canditates:FindFirstChild(script.Parent.Parent.Parent.Name) == nil then local val = Instance.new("StringValue") --Help val.Name = script.Parent.Parent.Parent.Name --Help val.Parent = game.ServerStorage.Interviewing.canditates --Help end close() end function no() close() end script.Parent.Frame.y.MouseButton1Click:connect(yes) script.Parent.Frame.n.MouseButton1Click:connect(no)
This is an interviewing system. So how does the script.Parent.Parent.Parent.Name work? And how does it find "Name"?
Link to Image V
https://postimg.org/image/nk5rk823x/
Most likely another script is placing it into a players PlayerGui and or that is already supposed to be in the StarterGui, but either way this script is getting the players name when placed in the PlayerGui.