So the good news is that my API key is valid! However, I get an error in the provided ModuleScript saying that “Argument 1 missing or nil” on line 95, which seems to be retrieving group data…? I’m not so sure if this is because of the script itself or your updates on the OpenCloud API.
local function getMembershipId(userId: number): (boolean, string)
local membershipFilter = `user == 'users/{userId}'`
local searchSuccess, responseBody = requestRobloxAPI(
`https://apis.roblox.com/cloud/v2/groups/{GROUP_ID}/memberships?maxPageSize=10&filter={membershipFilter}`,
"GET"
)
responseBody = HttpService:JSONDecode(responseBody.Body)
if searchSuccess and responseBody.groupMemberships and
responseBody.groupMemberships[1] and
responseBody.groupMemberships[1].path
then
--Path format: groups/{group_id}/memberships/{group_membership_id}
local unfilteredText = responseBody.groupMemberships[1].path
unfilteredText = string.split(unfilteredText, "/")
return true, unfilteredText[4]
else
return false, responseBody
end
end
Hmm not able to reproduce on my end. I would put a debug print statement right before line 95 printing the responseBody variable to see what it looks like (since it seems the body is missing from your screenshot). Let me know what your output is from that
I tried the Base64 encoded one. It didn’t work at the first time and then I used the original API key that we did at first step and I paste that in either on Roblox Studio and on roblox web. It actually worked.
lol what actually is the point of this update if it doesnt even work. I’ve tried everything bro roblox releases something and it never works. Literally if it’s not gonna work just remove this update. All I wanted to do was update a users group rank when they reached level 5 you can literally just put this directly in roblox studio. ROBLOX is ur website why are you making some API?
Hey there, what is not working for you? Can you share more information? Feel free to post a bug report if we missed anything, but we confirmed this feature is working fine if implemented according to the documentation.
I’m trying to rank a member when they step on a part in my game that levels you up +1 level so I’m trying to test stuff at the moment. I appreciate for reaching out. I want to make it so if you reach level 5 in my game you get autoranked to a specific role in my group it only works in roblox studio, bet never the actual game (aka live servers) also, since you responded.
Please dude for the love of god add compatibility lighting back. I’ve been begging you guys for almost a year now. It ruined my dancefloor game which relied on the lighting heavily it gets too bright and hurts my eyes. Or at least add brightness clamping as a option for the lighting settings. I have tried surfacelighting, problem with surfacelighting you can’t make it go all points of view like point lights do and leaves a huge bright line. I’ve tried to reduce the amount of point lights and it has shading issues for example if you jump it hurts your eyes because the light doesnt stay the same, but it like bounces. Like please reconsider my suggestion. Please
Explanation: Whenever requestRobloxAPI() is called, it returns 2 values, first one is the success boolean and the second one is the the rolesBody in JSON format. ‘rolesBody’ variable is then assigned a new value and that value is the second value returned out of the requestRobloxAPI() function. The new and updated ‘rolesBody’ value does NOT have a ‘groupRoles’ index directly because it is found in the array of the ‘Body’ index and as a result, you have to first index the ‘Body’ before accessing any values inside of that array.
Not to mention, but you also cannot loop through JSON arrays directly in Luau, hence the reason we’ve JSON decoded it.
At last, the final segment of that code should look something like this;
while rolesBody.nextPageToken ~= "" do
rolesSuccess, rolesBody = requestRobloxAPI(
`https://apis.roblox.com/cloud/v2/groups/{GROUP_ID}/roles?maxPageSize=20&pageToken={rolesBody.nextPageToken}`,
"GET"
)
rolesBody = HttpService:JSONDecode(rolesBody.Body)
if rolesSuccess and rolesBody and rolesBody.groupRoles == nil then
rolesBody = HttpService:JSONDecode(rolesBody.Body)
end
if rolesSuccess and rolesBody.groupRoles then
for _,v in pairs(rolesBody.groupRoles) do
table.insert(UNCLEANED_ROLES, v)
end
else
return false, "Could not get groupRoles nextPageToken reponse body!"
end
end