Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

gamepass service states my gamepass isnt real?

Asked by 6 years ago
Edited 6 years ago

i did a variable stating

gamepass = game:GetService("GamePassService") if gamepass:PlayerHasPass(player,778980) then

and it would give them extra points. When I tested in Studio, it said it wasnt a gamepass and to use MarketPlaceService:PlayerOwnsAsset or something and I did it but found out it didnt do gamepasses. Help

2 answers

Log in to vote
0
Answered by 6 years ago

You have to use the new gamepass service updates they came out with

1:UserOwnsGamePassAsync(player.userId, 778980)
Ad
Log in to vote
0
Answered by 6 years ago

My buddy Vissequ actually made a script post-update using the "UserOwnsGamepassAsync" function. All you have to do is edit the gamepass Id, and edit the variable outcome (what you want it to do, if it reads you own the script) Here is a copy of the script if you would like to use it:

01local MarketplaceService = game:GetService("MarketplaceService")
02local Players = game:GetService("Players")
03 
04local gamePassID = 0000000  -- Change this to your game pass ID
05 
06function onPlayerSpawned(player)
07 
08    local hasPass = false
09 
10    -- Check if the player already owns the game pass
11    local success, message = pcall(function()
12        hasPass = MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID)
13        print("Has Game Pass")
14    end)
15 
View all 35 lines...

Answer this question