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

This gamepass activation is'nt working. Any ideas?

Asked by 7 years ago
Edited 7 years ago

So basically I have a gamepass which when you buy it turns a boolean on. But that isnt working. I probed the script, tested some on servers and came to the conclusion that the boolean is'nt changing. But, the console shows no errors.

Thanks, -RadioactiveSherbet

    local passid = 440638589 -- Gamepass ID
local GamePassService = game:GetService("GamePassService")
game.Players.PlayerAdded:connect(function(player)
if GamePassService:PlayerHasPass(player, passid) then
    player.CGPH.Value = true
end
end)

Please downvote if you thought it through, and it would be nice to upvote

1 answer

Log in to vote
0
Answered by
Valatos 166
7 years ago
Edited 7 years ago
local GamepassId = 440638589 --     The gamepass ID we will be using
local GamepassService = game:GetService("GamePassService")
game.Players.PlayerAdded:connect(function(plr)
        if GamepassService:PlayerHasPass(plr, GamepassId) then
            print(plr.Name.." Has pass ("..GamepassId..")!") -- Just a print function that tells us that the player has the pass
            -- The line it has to do
        end
end)

Note: I haven't tested this yet, it may not work. Sorry if it doesn't work :D

Edit

The ROBLOX Wiki has a API page for GamepassService, just look there if you need any help

0
It still didnt work RadioactiveSherbet 30 — 7y
0
@RadioactiveSherbert, have you checked the Developer Console (Check both Server and Local Logs tabs) or Output to indicate if there are any errors. What environment are you testing this in (Studio Play Solo, Studio Test Server, Online Mode)? M39a9am3R 3210 — 7y
0
Online mode because gamepass queries dont work in Studio @M39a9am3R RadioactiveSherbet 30 — 7y
Ad

Answer this question