Advertisement
kill21_2

проверка игроков на скрипт

Jun 17th, 2025
8,213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local player = Players.LocalPlayer
  4.  
  5. local targetPosition = Vector3.new(54.72, 2118.34, -4394.019)
  6. local teleportInterval = 300 -- 5 минут (300 сек)
  7. local detectionRadius = 100 -- Радиус обнаружения (10 studs)
  8. local lastNotified = {} -- Защита от спама уведомлений
  9.  
  10. -- Функция для уведомления (только SendNotification)
  11. local function notify(message)
  12. pcall(function() -- Защита от ошибок, если SendNotification недоступен
  13. game.StarterGui:SetCore("SendNotification", {
  14. Title = "⚠️ Обнаружен игрок!",
  15. Text = message,
  16. Duration = 5
  17. })
  18. end)
  19. print("[ALERT]", message) -- Для отладки (можно удалить)
  20. end
  21.  
  22. -- Быстрая телепортация (туда и обратно)
  23. local function quickTeleport()
  24. if not player.Character then return end
  25. local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
  26. if not humanoidRootPart then return end
  27.  
  28. local originalCFrame = humanoidRootPart.CFrame
  29. humanoidRootPart.CFrame = CFrame.new(targetPosition)
  30. task.wait(0.05) -- Минимальная задержка
  31. humanoidRootPart.CFrame = originalCFrame
  32. end
  33.  
  34. -- Проверка игроков в зоне (вызывается часто)
  35. local function checkForPlayers()
  36. for _, otherPlayer in ipairs(Players:GetPlayers()) do
  37. if otherPlayer ~= player and otherPlayer.Character then
  38. local hrp = otherPlayer.Character:FindFirstChild("HumanoidRootPart")
  39. if hrp then
  40. local distance = (hrp.Position - targetPosition).Magnitude
  41. if distance < detectionRadius then
  42. if not lastNotified[otherPlayer] or (os.time() - lastNotified[otherPlayer]) > 30 then
  43. notify(otherPlayer.Name .. " у игрока запушен скрипт 1qlua!")
  44. lastNotified[otherPlayer] = os.time()
  45. end
  46. end
  47. end
  48. end
  49. end
  50. end
  51.  
  52. -- Основной цикл (телепортация каждые 5 минут)
  53. task.spawn(function()
  54. while true do
  55. quickTeleport()
  56. task.wait(teleportInterval)
  57. end
  58. end)
  59.  
  60. -- Постоянная проверка игроков (20 раз в секунду)
  61. RunService.Heartbeat:Connect(function()
  62. checkForPlayers()
  63. end)
  64.  
  65. -- Отслеживание новых игроков
  66. Players.PlayerAdded:Connect(function(newPlayer)
  67. newPlayer.CharacterAdded:Connect(function(char)
  68. if char:FindFirstChild("HumanoidRootPart") then
  69. char.HumanoidRootPart:GetPropertyChangedSignal("Position"):Connect(function()
  70. checkForPlayers()
  71. end)
  72. end
  73. end)
  74. end)
  75.  
  76. print("Скрипт активирован! Мониторинг игроков...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement