Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. local gamepassid = script:WaitForChild("Gamepass ID").Value
  2. local destination = game.Workspace:WaitForChild("Teleport To")
  3. local marketplace = game:GetService("MarketplaceService")
  4.  
  5. game.ReplicatedStorage:WaitForChild("Teleport").OnServerEvent:Connect(function(player)
  6. if marketplace then
  7. if player and gamepassid then
  8. if marketplace:UserOwnsGamePassAsync(player.UserId, gamepassid) then
  9. local char = game.Workspace:FindFirstChild(player.Name)
  10. if char then
  11. local root = char:FindFirstChild("HumanoidRootPart")
  12. if root and destination then
  13. root.Position = destination.Position
  14. end
  15. end
  16. else
  17. marketplace:PromptGamePassPurchase(player, gamepassid)
  18. end
  19. end
  20. end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement