I’m creating a remote event that’ll send me the profile of a user, like all of the in-game stats and whatnot, so I can utilize that in an admin panel. Everything is working out well so far, but apparently my game.Players:GetUserIdFromNameAsync() function isn’t returning the right UserID provided the correct username.
In this function, I input my username xynxae. The script is supposed to turn that into a userid and plug that into a key template, which can then access my datastore. However, when running all the code (and printing each result for debugging), this is what happens:
ID 73502 is the userId of the roblox player ‘Instance.’
I’ve never experienced an issue like this before and it’s really stunting progress on my game, so help would be appreciated.
That’s VERY weird. Maybe there’s something you’re doing within your code that does this? Mind showcasing the part of the code where you call this method and where you set it as a datastore key?
Hi! I just solved my problem as you sent the message. I made an oversight in defining the remote event function which would cause problems, but I appreciate your response!
When I was using the player input from the function, I forgot add the player variable first before adding my player INPUT variable.
In other words, instead of it being remotes.getProfile.OnServerEvent:Connect(function(player, playerName), it was remotes.getProfile.OnServerEvent:Connect(function(playerName).