Hi all. I’m trying to make a crystal GUI which works alongside Region3 to determine whether someone has found a crystal or not. I’ve got the region3 part down pat, but I have these “Mystery” crystal images which act as placeholders for the crystal images which will appear when they get found (using region3).
Now, when a player “finds” a crystal by entering that crystals region3 area, I want the “Mystery” crystal image’s visibility to turn to false (or be deleted). Then I’d like this vacant space where the mystery image used to be to be filled with the image of the crystal, by making the crystal image visible.
“Crystal” is the mystery image - “Crystal found” is the real image of the crystal…
The thing is, I have many of these different images, and I don’t know how to get the “mystery” image that is connected to the certain crystal image, and delete it.
`
Help would be greatly appreciated, thankyou.
assign each image a tag that corresponds with the associated crystal, and when the crystal is found loop through every image until you find a matching tag, then remove it and replace it with the other one
Rewriting the string.sub thing: if string.match(frame.Name, string.sub(v.Name, 1, (string.len(v.Name) - 5))) and not string.match(frame.Name, “Found”) then
“not” to check if its not the “Found” frame.
This will go under where you made the “Found” visible.
if found == true then
--Make images visible
if script.Parent.FoundClothing.Clothingframe.Scroll[v.Name].Visible == false then
script.Parent.FoundClothing.Clothingframe.Scroll[v.Name].Visible = true
local mystName = string.sub(v.Name, 1, (string.len(v.Name) - 5))
script.Parent.FoundClothing.Clothingframe.Scroll[mystName].Visible = false
--Turn visible off for mystery
break
end
end