uoryetwq

t 텔레포트

Mar 13th, 2025
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. local UserInputService = game:GetService("UserInputService")
  2. local Players = game:GetService("Players")
  3. local LocalPlayer = Players.LocalPlayer
  4.  
  5. -- T 키 입력 감지
  6. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  7. if gameProcessed then return end -- 채팅창 같은 UI에서 입력된 경우 무시
  8.  
  9. if input.KeyCode == Enum.KeyCode.T then
  10. local allPlayers = Players:GetPlayers()
  11.  
  12. -- 플레이어가 2명 이상인지 확인 (본인 제외 최소 1명 필요)
  13. if #allPlayers > 1 then
  14. local randomPlayer
  15. repeat
  16. randomPlayer = allPlayers[math.random(1, #allPlayers)]
  17. until randomPlayer ~= LocalPlayer and randomPlayer.Character and randomPlayer.Character:FindFirstChild("HumanoidRootPart")
  18.  
  19. -- 랜덤한 플레이어의 위치로 이동
  20. if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
  21. LocalPlayer.Character.HumanoidRootPart.CFrame = randomPlayer.Character.HumanoidRootPart.CFrame
  22. end
  23. end
  24. end
  25. end)
  26.  
Advertisement
Add Comment
Please, Sign In to add comment