the script i made keeps throwing errors at me and i try to fix them but it doesn't work. I'm trying to find the path to a specific text area so that people with the vip pass won't see the message. i know it sounds weird that i need to find the path to a gui i made myself, but i made it where all gui objects move into different areas (e.g. game.StarterGui.example.stuff to game.StarterGui.example.oof)
1 | for i,v in pairs (game:GetDescendants()) do |
2 | if string.find(v.StateType, Text) and v.Text = = "gvbadfuyhvbhdu" then |
3 | print (v:GetFullName()) |
4 | end |
5 | end |
Try using the IsA Instance method or just by checking the ClassName Instance property.
Examples:
1 | if v:IsA( 'GuiBase' ) the |
2 | -- Do Thing |
3 | end |
or
1 | if v.ClassName = = 'ScreenGui' then |
2 | -- Do Thing |
3 | end |
You can use v:IsA("ClassName")
to check if v
is of a certain class. In your case, your class name would be ScreenGui. If you're looking to find any textlabels, it would be TextLabel. If you don't know what the class name of something is, you can see it in the properties of said object.