Making a player rejoin after purchase

Hello!

I have been working on some gamepasses for my project and have been putting “You may need to rejoin after purchasing” in the descriptions. This made me think that if I make the player rejoin the game after they’ve purchased the gamepass automatically, so they don’t have to leave and rejoin themselves. The thing is, I want them to rejoin the same server that they were in before, instead of making them rejoin into a different server. How would I do this?

You could do this:

local TeleportService = game:GetService("TeleportService")
TeleportService:TeleportToPlaceInstance(game.PlaceId, game.JobId, player) -- we haven't linked a player variable yet, but if you have one, that's good.
1 Like