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

GamePassId '5010007' is not of type Game Pass. ???

that is the error message: GamePassId '5010007' is not of type Game Pass. Please use MarketplaceService:PlayerOwnsAsset instead.

this is my code:

local id = 5010007
 local Script = game.ServerScriptService.GamePassDoubleJump
 local LScript = game.ServerScriptService.GamePassDoubleJump.DoubleJump
 local scriptclone = LScript:clone()
game.Players.PlayerAdded:connect(function(player)
    if game:GetService("GamePassService"):PlayerHasPass(player, id) then 
        scriptclone.parent = game.Players.LocalPlayer.PlayerScripts
    end
end)

i have no idea why it isn't working.

2 comments

0

All that I know is that https://www.roblox.com/game-pass/5010007/Double-Jump exists, and that the output is incorrect.

0

actually they made a new gamepass system it wasnt the gamepass

3 answers

✓ Accepted answer

PlayerHasPass() is outdated, Here is the updates version, from now on, use game:GetService("MarketPlaceService"):UserOwnsGamePassAsync(player.UserId, id)

local id = 5010007
local Script = game.ServerScriptService.GamePassDoubleJump
local LScript = game.ServerScriptService.GamePassDoubleJump.DoubleJump
local scriptclone = LScript:clone()
	game.Players.PlayerAdded:connect(function(player)
	    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, id) then
	        scriptclone.parent = game.Players.LocalPlayer.PlayerScripts
	  end	
end)

Let me know if this works :)

10 comments

0

i also didnt put a capital p in Parent. but it works! :D

0

:D

0

oh btw i replaced local player because when i tested in a public server i tried it didnt work then i opened dev console (F9 menu)

0

saw there was an error the i put player instead of localplayer

0

nevemind didnt work :/

0

it only works in studio

0

is it a server script

0

i put it in serverscriptservice yes

0

Is it a regular script?

0

the script i showed yes the double jump one is a local script

They changed the thing with gamepasses.

there's really no point of explaining it here cause there's litterally all the code and explanaiton on wiki.

Here are the links:

dev forum post on changes

wiki link

1 comment

0

That's good to know. I didn't know about the new system.

im not good with marketplace service stuff, but in the error it says use MarketPlaceService and PlayerOwnsAsset instead, so maybe like this:

local id = 5010007
 local Script = game.ServerScriptService.GamePassDoubleJump
 local LScript = game.ServerScriptService.GamePassDoubleJump.DoubleJump
 local scriptclone = LScript:clone()
game.Players.PlayerAdded:connect(function(player)
    if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, id) then -- changed this
        scriptclone.parent = game.Players.LocalPlayer.PlayerScripts
    end
end)

2 comments

0

I didn't think about playeradded. Thanks I think this would work

0

nope, the MarketPlaceService does not include the functions of the GamePassService.

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