Hello! I am seeking help with making a script that checks if a value is inside a folder before doing something. Whenever a user presses a button on a gui, it moves one of the values into the folder (in order value 1, value 2, value 3 …) . I don’t want them to be able to click the second button until it checks that the first value is inside the folder
local folder = game:GetService("Workspace").CountryData.Jamaica.Technology.Slots
for i, v in pairs(folder:GetChildren()) do
if v:IsA("StringValue") then
print(v)
end
end
This simply prints a list of the values inside of the folder, how would I check if a value was inside the folder?
When putting the values there you should name them “1”, “2”, etc.
Then simply check if it is in the folder using folder:FindFirstChild(tostring(A_NUMBER))