ProfileService:Release() is not apart of the table

ik that I just wanted to check if you had accidentally deleted the said function

Yeah, it’s in the module still. I’m actually quite confused on what could even cause this.

Alright I found the solution. So when you call LoadProfileAsync, it returns a profile table with the properties which has a metatable pointed to the ProfileService module to access the functions. However in your code, you do self = setmetatable(profile, Data) which resets the previously set metatable and thus the profile loses access to all of its functions (AddUserId, Release etc)

Also a simple fix would be this provided that your data module doesn’t have any functions/properties with the same name as that of profile

self = setmetatable(Data, {__index = profile});

Another approach would be to do this:

self = setmetatable(profile, {__index = Data});

and in your data module do:

Data.__index = ProfileService

This would prevent conflicts between properties of the same name but functions still need to be unique

This worked! Awesome, thank you very much. I didn’t know that metatables cleared when set again (should’ve been obvious), thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.