✓ Accepted answer
You're using MarketplaceService:PlayerOwnsAsset() with a gamepass id, while that function only accepts the asset id.
Each gamepass has both asset id and gamepass id. Gamepass id is usually shorter than its asset id.
If you want to check if a player owns a gamepass by its gamepass id, you need to use MarketplaceService:UserOwnsGamePassAsync(), like this:
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 4653124) then
But you can also obtain the asset id of your gamepass to be able to use it with PlayerOwnsAsset():
if game:GetService("MarketplaceService"):PlayerOwnsAsset(player.UserId, 1929538711) then
So, with some corrections, your code should look like this:
local passOwners = {}
game.Players.PlayerAdded:Connect(function(plr)
passOwners[plr.Name] = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 4653124)
plr.CharacterAdded:Connect(function(char)
if passOwners[plr.Name] then
char:WaitForChild("Humanoid").WalkSpeed = 36
end
end)
end)
3 comments
Try this video: https://www.youtube.com/watch?v=4xKWeFB_Tmk
Please check your output, the problem must be from either the Script, or the Lines, since lines seem fine, try to use it in LocalScript, in Starterpack, or Workspace.
I think the error's your asset, it doesn't look like an actual item for me. I mean; it is, but it's owned by someone who's not you, and it's offsale. Might want to double-check the ID.