CanterCrow
(CanterCrow)
#1
Hi,
I have been looking for a better way of referencing frames and buttons etc.
At the moment I am using a lot of Parent chains but is there a way of referencing from the root of the StarterGui / PlayerGui?
For example PlayerGUI.Folder.Frame.item.value
this is what I a currently using and some others are a lot longer.
script.Parent.Parent.Parent.Parent.Shop1:GetChildren()
Thanks
Julian
SOTR654
(SOTR654)
#2
Use this:
PlayerGui - Server
local Players = game:GetService("Players")
Player = Players[...] --| Player.Name
PlayerGui = Player.PlayerGui
PlayerGui - Client
local Players = game:GetService("Players")
Player = Players.LocalPlayer
PlayerGui = Player.PlayerGui
StarterGui - Server
local StarterGui = game:GetService("StarterGui")
Then add a variable and make the string.
1 Like
CanterCrow
(CanterCrow)
#3
thanks works great, thank you for your help
Julian
SOTR654
(SOTR654)
#4
You’re welcome, happy to help ^ - ^