How Would I Make A Local Script/Client Script detect if theres two of the same GUI/UI and if there is it will execute a print script?
2 Likes
Define “same” same as object or other types size, position, identical?
3 Likes
anyway to detect it with the name of the ScreenGui
if statements are your best friend in comparision
if UIElement1.Name == UIElement2.Name then
print("identical name")
end
1 Like
what do i put in the 2 UIElements?
1 Like
The Two UIElements you want to compare to eachother
2 Likes
Maybe you can set an attribute for that specific ui? (So you can identify it more easily)
SetAttribute:
Ui:SetAttribute(Name,Value)
GetAttribute:
Ui:GetAttribute(Name)
(You can also set attribute using properties menu)
1 Like
yooo doge u mean like this
local Guis = 0
while task.wait(3) do
if Guis > 1 then
-- Your code here
break
end
for i, Gui in pairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
if Gui.Name == "[Gui name]" then
Guis = Guis + 1
end
end
end