Get the players name from UserId from data.key {ERROR}

Hey, so I am unable to transfer UserId into their user’s name. The issue I am recieving is the error code Unable to cast string to int64 - Server. I save the data with the UserId so that’s why the ID is the DataKey. Here is the code:

local name = Players:GetNameFromUserIdAsync(data.key) 

And the code where Data is set:

DataStore_timeOV:SetAsync(player.UserId, overallTime.Value)

Try

local name = Players:GetNameFromUserIdAsync(tonumber(data.key)) 

Isn’t data.key a numberic value already?

1 Like

doesn’t make a difference, but destroys one of the arguments.