Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Gamepass detection script not working properly?

I'm trying to make a script where it shows you if you have the gamepass or not, but it simply isn't working or anything. Yes I do have the gamepass obviously.

-- Gamepasses Script 
-- Written by CarlPIandog

-- // Extra Freight Gamepass \\
local passId = 4657110 -- change this to your game pass ID.

function isAuthenticated(player) -- checks to see if the player owns your pass
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end

game.Players.PlayerAdded:connect(function(plr)
    if isAuthenticated(plr) then
script.Parent.ExtraFreight.Visible = true
    end
end)

-- // Gamepass \\
-- Copy and paste rest above 

2 comments

0

Lol how

1 answer

✓ Accepted answer

Hello, CarlPIandog!

I changed the part where you test if player owns a asset to if player owns a gamepass

-- Gamepasses Script 
-- Written by CarlPIandog

-- // Extra Freight Gamepass \\
local passId = 4657110 -- change this to your game pass ID.

function isAuthenticated(player) -- checks to see if the player owns your pass
    return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, passId)
end

game.Players.PlayerAdded:connect(function(plr)
    if isAuthenticated(plr) then
script.Parent.ExtraFreight.Visible = true
    end
end)

-- // Gamepass \\
-- Copy and paste rest above 


Hope this helps!

Good Luck with you games

5 comments

0

It still doesn't work for some reason.

0

any errors?

0

Nope.

0

Is the gamepass id correct?

0

Yes

This discussion is preserved as it was. New answers, comments, and votes are closed.