Recently, there was an error in the console that said internal error or something. It said that these lines of codes were the ones that were causing the error. The error also caused part of my game to stopped working so I could not ignore this. This function would be ran when a player’s character is loaded. The error seemed to appear when a lot of people are in the server. Is there something wrong with my code?
function Gamepasstest(player,id)
if marketplace:UserOwnsGamePassAsync(player.UserId,id) == true or player.UserId == 2274979528 then
return true
else
return false
end
end
Basically I would say if Gamepasstest([player name],[gamepass] == true then I would give the player the benefits they needed. I ran this line about like 10 times or something when the player character loads for different groups.
local function ownsgamepass(userid,gamepassid)
local s,res = pcall(marketPlaceService.UserOwnsGamePassAsync,marketPlaceService,userid,gamepassid)
if not s then
res = false
end
return res
end
I’m going to mark this as the solution for now as the problem is not occurring since not a lot of players are playing the game now. I will find a new solution when the error reproduces.