Honestly Losing my mind i don't think GetUserInfosByUserIdsAsync works

Im making a donation board system and i want it to have the display name anyways i define the UserID and i test play the game and it says

Capture1
I feel like it doesnt read the userid? but when i print it it prints the userId so its very confusing and im losing my mind :laughing:

The error mentions type so try printing the type as well.

print(typeof(UserID),tonumber(UserID))

Capture
it keeps saying this even when i try another way or either its saying this
UserService: invalid userId(s) given. Please make sure they are of number type

Set UserId to tonumber(data.key) and make sure the id is real(a fake id will have a number less than 1, which is a Roblox studio test account such as Player1, Player2 etc.).

2 Likes

Instead of doing this

print(typeof(UserInfo[1].DisplayName))

I just did this instead and it printed out the displayname

print((UserInfo[1].DisplayName))

thanks for the help though

1 Like

GetUserInfosByUserIdsAsync works on players that are in the server

According to documentation the function enables developers to request information about users outside of the current Datamodel, also I was able to use the function directly inside Roblox studio(for another id), therefore I assume your claim is incorrect.

1 Like

Well I some people say that its only for those people who are inside the Datamodel

yeah your claim is incorrect because i just hopped onto an alt to check if the display name was still on the leaderboard and it was correct so this is false :+1:

1 Like

https://developer.roblox.com/en-us/api-reference/function/Players/GetPlayerByUserId

You may be getting confused with this, this does require the player to be present (exist within the DataModel hierarchy of an active server session) in order for the player instance to be fetched from their user ID.