#How to Check for varying values in a table
1 messages · Page 1 of 1 (latest)
for loops
i mean yeah that, idk how to say "if all of them are true/max value" though
** You are now Level 9! **
still need help?
do not fear an s4 is here
yeah
local function isAllTrueMax()
for _, v in whereTheValuesAre:GetDescendants() do
if v:IsA("IntConstrainedValue") then
if v.Value ~= v.MaxValue then return false end
end
if v:IsA("BoolValue") then
if not v.Value then return false end
end
end
return true
end
so i was right...... i second guessed my self and didnt send cuz i ain want my s1 revoked for sending something thats basic knowledge but it doesnt work...
so its checking each and ending it early if any of them aren't max or true, then returning true if it gets to the end?
yep :)
yooo thats smart
so if i wanna see the function i can just set a variable to the return and connect it to a separate function if it's true then
thanks man
hold on so i tried connecting the return and saying "if [return variable] then [complete function] else return end"
didnt work
what's happening
can u send what u wrote
completeCheck is just what you wrote out for me, done() is what I want to happen if it returns true
the error comes in with checking the return value as a boolean
done will run for every single thing that has the right value
oh true i gotta fix that
the other problem is that it doesn't recognize the return value correctly
wait but it only runs if your function returns true, it won't do that unless everything comes back correctly, right?
no it's doing it in a loop
so it will do it right after it validates
and then it won't return so it will continue the loop
i recommend u do the rewards separate from updating the text
i was trying to make it so everytime something is completed it would check again, what should i do instead
"nothing better than that thrill you get from solving a bug solo dolo, imo" - Me
💀
does roblox even let me return raw values
i tried it with a number value too and wouldnt work
does it have to be a variable
ye something like that
yeah it works fine, the only problem i can even see so far is that I can't return the true/false statement from the function