Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gamepassid = script:WaitForChild("Gamepass ID").Value
- local destination = game.Workspace:WaitForChild("Teleport To")
- local marketplace = game:GetService("MarketplaceService")
- game.ReplicatedStorage:WaitForChild("Teleport").OnServerEvent:Connect(function(player)
- if marketplace then
- if player and gamepassid then
- if marketplace:UserOwnsGamePassAsync(player.UserId, gamepassid) then
- local char = game.Workspace:FindFirstChild(player.Name)
- if char then
- local root = char:FindFirstChild("HumanoidRootPart")
- if root and destination then
- root.Position = destination.Position
- end
- end
- else
- marketplace:PromptGamePassPurchase(player, gamepassid)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement