I dont know why, but this has always confused me, so if you could explain it to me as if I was a beginner that would be helpful.
This is my code:
I want something to happen after that BUT ONLY if the player has purchased the gamepass and didn’t cancel. How do I do that? Is it the same for developer items? Or is it different depending on the item?
wasPurchased is basically a boolean, and you can use it to check if the player bought the gamepass or clicked cancel.
if the player bought the gamepass, it will return true.
if the player cancelled the gamepass purchase, it will return false.
This means that you can check if the player bought the gamepass or cancelled it by using:
if wasPurchased == true then
print("Player bought the gamepass successfully!")
--Any other lines of code written here will run once the player buys the gamepass.
end
if wasPurchased == false then
print("Player cancelled gamepass purchase!")
--Any other lines of code written here will run once the player cancels the gamepass purchase.
end
i saw some guy claim that he has 10 years of luau experience but he created a new topic in “help and feedback” and he was wondering why LocalScript wouldnt run in Workspace