Advertisement
Herobrinekid2

Game teleporter

Sep 24th, 2022
884
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local Module = require(game.ServerScriptService.ModuleScript)
  2.  
  3.  
  4. local Tping = {}
  5. local Id = 11041386987
  6.  
  7.  
  8.  
  9.  
  10. script.Parent.PrimaryPart.Touched:Connect(function(H)
  11.    
  12.     if H.Parent:FindFirstChild("Humanoid") then
  13.        
  14.         local Plr = game.Players:GetPlayerFromCharacter(H.Parent)
  15.        
  16.        
  17.         if not table.find(Tping,Plr.Name) then
  18.             table.insert(Tping,Plr.Name)
  19.            
  20.             local Signal = Module:Teleport(Id,{Plr})
  21.            
  22.             Signal:ListenForFail(function(Res)
  23.                
  24.                 if Res ~= Enum.TeleportResult.IsTeleporting then
  25.                     local Index = table.find(Tping,Plr.Name)
  26.                    
  27.                     if Index then
  28.                         table.remove(Tping,Index)
  29.                     end
  30.                    
  31.                     warn(Res)
  32.                 end
  33.                
  34.             end)
  35.            
  36.         end
  37.        
  38.        
  39.     end
  40.    
  41. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement