DcMasterHD_12

Esto va en ServerscriptService

Sep 20th, 2019
121
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data