Is there any other beside FindFirstChild that doesn't require a string? I need it because I want this script to work universally so I won't have to keep changing the Guis name.
Ok,so this is how the script works it finds the player distance if distance is less then 4 then it will clone the Gui into the Players Gui and then it will see if the player has the Gui by checking the Guis name,however if the the player already has a gui with the same name it won't work,is there another way to do it? The script is setup like this.
For example: Tag a object and make it find it first.
Copy = Gui:Clone()--Tagged as Copy
FoundCopy = Player.PlayerGui:FindFirstChild(Copy)
while wait() do
for _,Player in pairs( game.Players:GetChildren() ) do
-------------------------------------------------------
local Part = script.Parent
local Character = Player.Character
local Distance = (Character.Torso.Position - Part.Position).magnitude
-------------------------------------------------------
print(Distance)
if Distance < 4 then
for _,Gui in pairs (Part.GuiFolder:GetChildren())do
Copy = Gui:Clone()
FoundCopy = Player.PlayerGui:FindFirstChild(Copy.Name)---Finds the Gui named "ScreenGui"
if not FoundCopy then---Checks if the player doesn't have the gui
Copy.Parent = Player.PlayerGui
end
end
end
end
end

10 comments
Agreed I was going to ask that. Here have some comment time
How about now?
What part are you talking about, finding the backpack in it incase you change the name, or the gui in the backpack, or both, or if the player has the gui already?
Finding it in the backpack just in case I change the name
Oh... updating post.
No. To fix this you would need a BoolValue or something to verify that its that screengui.
Will it work if It has a lot of Guis in the players backpack,and if so how would I check if the player has the specific gui so it will stop cloning?
and If you can,can you add to the script?
Yes.
Oh and if I wanted to remove that specific Gui how would I remove it?Oh, and sorry for all these requests.