You can write your topic however you want, but you need to answer these questions:
for the gamepass to work and for it to show as owned, as i am the creator i should already own them, but when in game it prints not owned
What is the issue? Include screenshots / videos if possible!
local owns = ownsgamepass(player.UserId, gamepassId)
if owns then
player.Psp.Value += value*player.pZoneMulti.Value*classMult*2
print("owns")
else
player.Psp.Value += value*player.pZoneMulti.Value*classMult
print("Dosen't Own")
end
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i’ve looked on the hub to see if their was any information about it but didn’t see any relating it
local function ownsgamepass(userid, gamepassId)
local s,res = pcall(MarketPlaceService.UserOwnsGamePassAsync, MarketPlaceService, gamepassId)
if not s then
res = false
end
return res
end
This could probably be why, I honestly don’t know what you’re even doing with this but a pcall should take form in a custom function of yours
Try this:
local function ownsgamepass(UserId, GamepassID)
local success, oops = pcall(function()
MarketPlaceService:UserOwnsGamePassAsync(UserId, GamepassID) --You also defined it as a dot syntax, not a colon
end)
if success then
res = true
else
res = false
warn(oops)
end
return res
end
local function ownsgamepass(UserId, GamepassID)
local res = false
local success, oops = pcall(function()
MarketPlaceService:UserOwnsGamePassAsync(UserId, GamepassID) --You also defined it as a dot syntax, not a colon
end)
if success then
res = true
else
res = false
warn(oops)
end
return res
end
@JackscarIitt you are confusing the API request successfully sending a response with the response itself(if the user owns the pass). Instead the function should be:
function ownsgamepass(UserId, GamepassID)
local owned = false
local success, Error = pcall(function()
owned = MarketPlaceService:UserOwnsGamePassAsync(UserId, GamepassID)
end)
if success then
return owned
else
warn(Error)
end
end