Advertisement
Freshbloodb

Untitled

Nov 26th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local LocalPlayer = Players.LocalPlayer
  3. local RunService = game:GetService("RunService")
  4.  
  5. local TRANSFER_DISTANCE = 20 -- Distancia doble del rango normal (ajústalo según sea necesario)
  6.  
  7. local function TransferBomb()
  8. local Character = LocalPlayer.Character
  9. if not Character then return end
  10.  
  11. local Bomb = Character:FindFirstChild("Bomb") or Character:FindFirstChildWhichIsA("Tool")
  12. if not Bomb then return end
  13.  
  14. local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
  15. if not HumanoidRootPart then return end
  16.  
  17. for _, player in ipairs(Players:GetPlayers()) do
  18. if player == LocalPlayer then continue end
  19.  
  20. local TargetCharacter = player.Character
  21. if not TargetCharacter then continue end
  22.  
  23. local TargetRootPart = TargetCharacter:FindFirstChild("HumanoidRootPart")
  24. if not TargetRootPart then continue end
  25.  
  26. -- Verificar distancia
  27. local Distance = (HumanoidRootPart.Position - TargetRootPart.Position).Magnitude
  28. if Distance <= TRANSFER_DISTANCE then
  29. -- Transferir bomba al jugador objetivo
  30. Bomb.Parent = TargetCharacter
  31. print("Bomba transferida a:", player.Name)
  32.  
  33. -- Opcional: Notificación al jugador
  34. game:GetService("StarterGui"):SetCore("SendNotification", {
  35. Title = "¡Bomba Transferida!";
  36. Text = "La bomba fue pasada a " .. player.Name;
  37. Duration = 3;
  38. })
  39. break
  40. end
  41. end
  42. end
  43.  
  44. RunService.Heartbeat:Connect(TransferBomb)
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement