I have this function here where it awards the player after the round ends. This error that it’s throwing me is making me confused as I think it’s occurring when I’m trying to find if the player owns the gamepass but personally I don’t see any problems with this code
function RoundClass:AwardPlayer(player) -- award the player points and wins after the round ends
local VIP_ID = 41982359 -- id for vip gamepass
local profile = StatsManager:GetData(player)
-- check if the player has the gamepass and wrap it around a pcall to catch errors and what not
local success, result = pcall(function()
return MarketPlaceService:UserOwnsGamePassAsync(player.UserId, VIP_ID)
end)
-- if the player has the gamepass, reward them with the vip award, if not reward them with the default award
if success then
if result then
profile.Points += self.VIPAward
profile.Wins += 1
else
profile.Points += self.RoundAward
profile.Wins += 1
end
else
error("There's an error trying to figure out if the player owns the gamepass: " .. result)
end
end
This is the error that it’s giving me: