Internal Service Error

So this has been strangely happening to me recently with my latest project, but I consistently get internalserviceerror when calling userowngamepassasync for the radio pass. It’s gotten so bad to the point that I had to put it in a pcall to stop my gamescript from breaking from time to time. It is also called on character added to give players the radio accessory, and that has just errored for the first time.

Here are some examples of functions I use to check for passes:

GameScript Functions

 local function CheckPermissions(player, Type)
	if Type == "CheckOwner" then
		local Owners = Module.Creators
		for o = 1, #Owners do
			if Owners[o] == player.UserId then
				return true 
			end
		end
	elseif Type == "CheckAdmin" then
		local Admins = Module.Admins
		for a = 1, #Admins do
			if Admins[a] == player.UserId then
				return true 
			end
		end
	elseif Type == "CheckIntern" then
		local Interns = Module.Interns
		for i = 1, #Interns do
			if Interns[i] == player.UserId then
				return true 
			end
		end
	elseif Type == "CheckMod" then
		local Mods = Module.Mods
		for i = 1, #Mods do
			if Mods[i] == player.UserId then
				return true 
			end
		end
	end
	return false
end

local function CheckGP(player, Pass)
	local HasPass = false
	local Success, Error = pcall(function()
		if MPS:UserOwnsGamePassAsync(player.UserId, Pass) then
			HasPass = true
		end
	end)
	if Success then
		return HasPass
	else
		warn("There was an issue checking a player for a pass, Handling Now!")
	end
end

local function CheckForRadioAccess(player)
	local Radio = false
	local Success, Error = pcall(function()
		if MPS:UserOwnsGamePassAsync(player.UserId, GPIDS.Radio) or CheckPermissions(player, "CheckOwner") or CheckPermissions(player, "CheckAdmin") or CheckPermissions(player, "CheckIntern") or CheckPermissions(player, "CheckMod") then
			Radio = true
		end
	end)
	if Success then
		print("Checking "..player.Name.." for radio access")
		return Radio
	else
		warn("There was an issue in checking a player for a radio. Handling Now!")
	end
end

as you see I had added that pcall to stop the game from breaking everytime the error happens

Now this is an example of it being used like when players receive roles as murderer, bystander or sheriff:

for x = 1, 1 do
			local ran = math.random(1, #PlayersToAssign)
			local player = game.Players:FindFirstChild(PlayersToAssign[ran])
			if player then
				if player.Character ~= nil  then
					local Main = player.PlayerGui:WaitForChild("Main")
					local Back = Main:WaitForChild("Back")
					local Spectate = Back:WaitForChild("Spectate")
					local Shop = Back:WaitForChild("Shop")
					local SpectateFrame = Main:WaitForChild("SpectateFrame")
					local ShopFrame = Main:WaitForChild("ShopFrame")
					Spectate:Destroy()
					Shop:Destroy()
					SpectateFrame:Destroy()
					ShopFrame:Destroy()
					if CheckForRadioAccess(player) then
						local RadioGui = game.ReplicatedStorage["UI's"].RadioUi:Clone()
						RadioGui.Parent = player.PlayerGui.Main
					end
					local Role = Instance.new("StringValue")
					Role.Name = "Role"
					Role.Parent = player.Character
					Role.Value = "Murderer"
					LastMurderer = player.Name
					local spawns = GetMap.SpawnPoints:GetChildren()
					local ranspawn = math.random(1, #spawns)
					if player.Character:FindFirstChild("Torso") then
						player.Character.Torso.CFrame = CFrame.new(spawns[ranspawn].Position)
					end
					events.ClientMessage:FireClient(player, "AssignRole", "YOU ARE THE MURDERER!", "Murderer")
					local GetRagdoll = script.Ragdoll:Clone()
					GetRagdoll.Parent = player.Character
					GetRagdoll.Disabled = false
					player.Character.Humanoid.Died:Connect(function()
						UpdateSpectate(player, "OnDeath")
					end)
					coroutine.resume(coroutine.create(function()
						wait(3)
						for i = 5, 1, -1 do
							wait(1)
							events.ClientMessage:FireClient(player, "RecieveWeapon", "Recieving your weapon in", "Murderer", i)
							if player.Character:FindFirstChild("Role") == nil then
								events.ClientMessage:FireClient(player, "BreakReciever")
								break
							end
						end
						wait(1)
						if player.Character:FindFirstChild("Role") ~= nil then
							local Knife = Tools.Knife:Clone()
							Knife.Parent = player.Backpack
						end
					end))
					table.remove(PlayersToAssign, ran)
				end
			end
		end

You dont have to put HUGE code. All you have to do is check the player by the id.

local OwnerId = YourUserId
local AdminId = TheAdminId

And use it by ids, not usernames because if you use it by usernames… What if the player changes there username right? Yeah so you dont need to do all of that coding.

I do use userid, you didn’t see the module, each thing I loop through is a table of userids for players with permissions, also I loop through it because it’s a table, not just 1 id to a variable.

also it isn’t huge code either, that second chunk of code is a for the murderer when a game starts

I use CheckForRadioAccess which calls the MPS:UserOwnsGamePassAsync to check if players have the radio accessory pass, and if they do it spawns a UI for them. This pcall was added because I kept getting internalserviceerror for it for some reason, even though I have never gotten it for this function before.
I also use the above function for when players can buy the radio accessory at the shop:
local function BuyRadioAccess(player)
if CheckGP(player, GPIDS.Radio) == false then
if player.leaderstats.Money.Value >= 400 then
player.leaderstats.Money.Value = player.leaderstats.Money.Value - 400
MPS:UserOwnsGamePassAsync(player.UserId, GPIDS.Radio)
local RadioGui = game.ReplicatedStorage[“UI’s”].RadioUi:Clone()
RadioGui.Parent = player.PlayerGui.Main
events.ClientMessage:FireClient(player, “SuccessMessage”, “Successfully Purchased Radio Access!”, “Shop”)
else
events.ClientMessage:FireClient(player, “FailMessage”, “You do not have enough money for this item!”, “Shop”)
end
else
events.ClientMessage:FireClient(player, “FailMessage”, “You already own this item!”, “Shop”)
end
end

as you can see I call the CheckGP function to see if the player owns the radio gamepass, if they don’t it will call the MPS:UserOwnsGamePassAsync to give them the pass, and spawn the radio UI.
Anyways, I keep getting this weird error and I don’t know why. I’ve never had this problem before and it’s freaking me out a bit.

I do the same thing, but I give the ui during the round, everytime I call for UserOwnsGamePassAsync as of lately , there’s always internal service error happening all of a sudden which i why I pcalled it. This issue seems to randomly happen when players leave the game quick and the only way to stop it from breaking code that’s not a part of an event it putting it in a pcall.