How would I get the player instance from a UserId from a different server?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I’m making a global matchmaking system, and to actually teleport players, I’d need to get the player instances.
  2. What is the issue? Include screenshots / videos if possible!
    The issue is that the documentation of GetPlayerByUserId specifically does not allow this as it only uses a simple loop script for this function. Testing also proves that it doesn’t work, as it returns nil for getting player objects in different servers.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried to look at devforum solutions, their mainly just people saying, “I didn’t need a player instance for this, thank you.”

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Keep in mind that I’m not really looking for pre-set modules, I’m looking for ideas so I can achieve this by myself.

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

You could use MessagingService to communicate with game’s servers, get information out of them and execute code inside them It’s very useful.

Let me explain the service:

Basically you’ve got two main function - :SubscribeAsync() and :PublishAsync(). It basically works like YouTube.

You can create a topic and listen for it to be published using :SubscribeAsync(), then execute a function once it was published.

With :PublishAsync(), you publish the topic to your subscribers and they will execute code afterwards.

You can’t just get a player instance from a UserID but you can get information via a proxy or apis.roblox.com .

I’m currently using MessagingService for my Matchmaking system, the problem is that when you turn a UserId to a player and that player is not in the current server, it returns nil.

Then just don’t turn it to a player? You can also check for the player with only this simple if statement to prevent the erroring:

if player then --if its not nil
    --code here
else --if it is nil
    --code here
end

You don’t know what I mean. I need to turn it into a player for TeleportService. Using an if statement doesn’t matter because like @IAmBanFor_Devforum said, it’s impossible. I’m looking for other functions or other methods that can achieve what I’m asking, Eg: Function that teleports player’s to a different game without Player instance array.

your gonna have to use outside services like what @IAmBanFor_Devforum said, this isnt possibly inside roblox atm

Thank you guys, for helping me, I fixed my problem.

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