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

Did ROBLOX changed gamepass ID's?

Asked by
snewo12 72
5 years ago

This is really strange...

The current ID of the gamepass is 2925833. It was 957014577 before. I've put the new ID (2925833) inside a script (see below), but it doesn't work... But when I put the old one (957014577), it does! What's the problem??

Link to the vehicle gamepass https://www.roblox.com/game-pass/2925833/PRE-ORDER-Plaxton-President-OPEN-TOP

Here is the script, just in case (it's a regen gamepass script).

local marketplaceservice = game:GetService("MarketplaceService")
local debounce = false
local model = game.ServerStorage.opentop 

function clicked(player)
    if debounce then return end -- Stops the button being clicked whilst it is deactivated
    debounce = true
    if marketplaceservice:PlayerOwnsAsset(player, 957014577) then

    newModel = model:Clone()
    newModel.Parent = workspace 
    script.Parent.BrickColor = BrickColor.new("Really black") -- changes part colour to red to show its inactive
    newModel:makeJoints() -- Stops the model falling apart when it is spawned.
    wait(20) -- Time it takes for regen button to work again
    script.Parent.BrickColor = BrickColor.new("Eggplant") 
    end
    debounce = false


end

script.Parent.ClickDetector.MouseClick:connect(clicked)  

Any help would be appreciated.

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Yeah, they did. Thankfully, my friend Vissequ made a script for this purpose:

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local gamePassID = 000000  -- Change this to your game pass ID 

function onPlayerSpawned(player) 

    local hasPass = false

    -- Check if the player already owns the game pass
    local success, message = pcall(function()
        hasPass = MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID)
        print("Has Game Pass")
    end)

    -- If there's an error, issue a warning and exit the function
    if not success then
        warn("Error while checking if player has pass: " .. tostring(message))
        return
    end

    if hasPass == true then
       --Under this hasPass line, and above the end marks, put what you want it to do if the player owns the gamepass
    end
end 

game.Players.PlayerAdded:connect(function(player)
  player.CharacterAdded:connect(function()
    onPlayerSpawned(player)
  end)
end)

-- Connect 'PlayerAdded' events to the 'onPlayerAdded()' function
Players.PlayerAdded:Connect(onPlayerSpawned)
0
I've figured it out already though but this line: "MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID)" was the problem. I only did (userId, gamePassID). Hah, thank you! snewo12 72 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

I don't think so. If they did, the numbers would have significantly changed.

0
This happened to me too. Very bizarre. Pixelated_MC 33 — 5y
0
Well, I'm stucking to the old IDs... Rip new gamepasses for me. snewo12 72 — 5y

Answer this question