The main way to teleport a player is to set the CFrame of their root part (HumanoidRootPart).
You should now use MarketplaceService instead of GamePassService. Link to the API here: https://developer.roblox.com/api-reference/class/MarketplaceService
In particular, this function will be used in your case: https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync
You may try this:
local gamepass =
local mp = game.MarketplaceService
local players = game.Players
players.PlayerAdded:Connect(function(player)
if mp:UserOwnsGamePassAsync(player.UserId, gamepass) then
player.CharacterAdded:Connect(function(character)
character.HumanoidRootPart.CFrame = CFrame.new()
end)
end
end)
What this does is when a player joins, it checks if they own the gamepass using the function I spoke about then create a function attached each them their character is added (when their character loads or respawns for example) to teleport them to a given location marked by a CFrame value.
For tracking after a gamepass purchase prompt, you'd use this:
https://developer.roblox.com/api-reference/event/MarketplaceService/PromptGamePassPurchaseFinished
mp.PromptGamePassPurchaseFinished:Connect(function(player, gamepassID, wasPurchased)
if gamepassID == gamepass and wasPurchased then
local character = player.Character
local humanoidRootPart = character.HumanoidRootPart
humanoidRootPart.CFrame = CFrame.new()
end
end)