How can I detect if a Player has a Gamepass in a LocalScript?


This is my script so far, but the first part doesn’t work which detects the script.

function Close(player)
   if game:GetService("MarketplaceService"):UserOwnsGamePassASync(player, 5694417) then
      script.Parent.Parent.MainFrame:TweenPosition(, -320,0.5, -295))
      script.Parent.Parent.Purchase:TweenPosition(, -320,0.5, -295))	



You are forgetting the extra parts for TweenPosition. Should look like this

Frame:TweenPosition(, 5, 0, 5), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 1)

You can change the easing direction and style, just used as a base.


I am not the best at working with gamepasses, but I think you can only check using normal scripts since LocalScripts are only for the local player and probably can’t check it

Not entirely sure, but that’s ny theory


It’s not that. The tweening actually works, it’s the “UserOwnsGamePass”


You definitely can, I’ve done it before.


Okay then


Oh you need to do Player.UserId instead of just Player. @CarlPIandog


check your spellings properly. Lua is case-sensitive.

“UserOwnsGamePassAsync” is the proper spelling.


A bit off topic, but I wonder why people use ASync over Async…?

From what I understand they aren’t two words, Async = asynchronous (so ASynchronous wouldn’t make sense grammatically). I’m genuinely curious about the naming convention for this.


I think a lot of people don’t actually know that ‘Async’ at the end of the function means ‘Asynchronous’, and they just rope learn the function name as it is - this may lead to capitalization errors and not actually spotting that its wrong.

This is from experience, when I first started I never actually knew what the ‘Async’ meant or did, everything just fell into place and worked.


If they misspell “Async”, then they probably don’t even know what it is/means. (just like what @JohnnyMorganz said.)

They might just be totally clueless and doesn’t know the proper spelling, I can’t blame them for that. “Asynchronous” is not a commonly used word, so it might be very new to some people.

Another thing that could happen is that they might type too fast and lifted their pinky too late which makes capitalization errors more common (I can relate.)