Error: attempt to yield across metamethod/C-call boundary
Code on client:
local RequestSuccess, Response = pcall(function()
return MiddleMan:InvokeServer('CheckPurchased',itemKey)
end)
Code on server (simplified):
function MiddleMan.OnServerInvoke (client,mode,...)
local args = {...}
if mode=='CheckPurshased' then
local purchased = PurchasesStorage:GetAsync(tostring(client.userId) .. '_' .. tostring(args[1]))
return (purchased==1)
end
end
NOTES:
MiddleManis a RemoteFunction in ReplicatedStorage;itemKeyis astring;PurchasesStorageis a GlobalDataStore;Data saved on
PurchasesStorageis always saved as:- Key:
userId_itemKey; - Value:
1
- Key:
Why is this happening? How to fix it?
Any help is highly appreciated.

2 comments
GetAsync yields the thread, something you can't do in a C thread.
Solution. You just have to put it in code because I'm lazy.