What do you want to achieve? Keep it simple and clear!
I want to know what SUCCESS will equal to (false or true) if the GETASYNC line of code never finds the playerProductKey inside the data
Some other unrelated questions: Imagine a function outside the ((elseif not success)) if the error(“…”) inside that elseif statement runs will it exit the function.
Again image a function outside of the ((if success and purchased)) if the line of code inside runs will it exit the function and stop running the code after it
success, errorMessage = pcall(function()
purchased = purchaseHistoryStore:GetAsync(playerProductKey)
end)
if success and purchased then
return Enum.ProductPurchaseDecision.PurchaseGranted
elseif not success then
error("Data store error:" .. errorMessage)
end
itd be false if youre trying to hit the elseif loop. replacing the elseif with an else loop works as well since all youre looking for is a true success var
itll exit the function yes since there isnt anymore code to run it just wont return anything, if success and purchased do have a value then its going to return that enum and will exit the function, not running the elseif loop argument
You were wrong about if about if purchased equals false then success will also equal false; apparently what purchased equals to has no effect on success which makes much more sense.