Sungmingamerpro13

PartTouched with TeleportData

Jun 16th, 2026
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.61 KB | None | 0 0
  1. local TeleportService = game:GetService("TeleportService")
  2.  
  3. local placeID = 102673616782312
  4.  
  5. script.Parent.Touched:Connect(function(hit)
  6.     if hit.Parent:FindFirstChild("Humanoid") then
  7.        
  8.         local Character = hit.Parent
  9.         local player = game.Players:GetPlayerFromCharacter(Character)
  10.        
  11.         local teleportOptions = Instance.new("TeleportOptions")
  12.         teleportOptions.ShouldReserveServer = true
  13.        
  14.         local teleportData = {
  15.             AddWins = true,
  16.             PlayerName = player.UserId
  17.         }
  18.        
  19.         teleportOptions:SetTeleportData(teleportData)
  20.        
  21.         TeleportService:TeleportAsync(placeID, {player}, teleportOptions)
  22.     end
  23. end)
  24.  
Advertisement
Add Comment
Please, Sign In to add comment