Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local player = Players.LocalPlayer
- local targetPosition = Vector3.new(54.72, 2118.34, -4394.019)
- local teleportInterval = 300 -- 5 минут (300 сек)
- local detectionRadius = 100 -- Радиус обнаружения (10 studs)
- local lastNotified = {} -- Защита от спама уведомлений
- -- Функция для уведомления (только SendNotification)
- local function notify(message)
- pcall(function() -- Защита от ошибок, если SendNotification недоступен
- game.StarterGui:SetCore("SendNotification", {
- Title = "⚠️ Обнаружен игрок!",
- Text = message,
- Duration = 5
- })
- end)
- print("[ALERT]", message) -- Для отладки (можно удалить)
- end
- -- Быстрая телепортация (туда и обратно)
- local function quickTeleport()
- if not player.Character then return end
- local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
- if not humanoidRootPart then return end
- local originalCFrame = humanoidRootPart.CFrame
- humanoidRootPart.CFrame = CFrame.new(targetPosition)
- task.wait(0.05) -- Минимальная задержка
- humanoidRootPart.CFrame = originalCFrame
- end
- -- Проверка игроков в зоне (вызывается часто)
- local function checkForPlayers()
- for _, otherPlayer in ipairs(Players:GetPlayers()) do
- if otherPlayer ~= player and otherPlayer.Character then
- local hrp = otherPlayer.Character:FindFirstChild("HumanoidRootPart")
- if hrp then
- local distance = (hrp.Position - targetPosition).Magnitude
- if distance < detectionRadius then
- if not lastNotified[otherPlayer] or (os.time() - lastNotified[otherPlayer]) > 30 then
- notify(otherPlayer.Name .. " у игрока запушен скрипт 1qlua!")
- lastNotified[otherPlayer] = os.time()
- end
- end
- end
- end
- end
- end
- -- Основной цикл (телепортация каждые 5 минут)
- task.spawn(function()
- while true do
- quickTeleport()
- task.wait(teleportInterval)
- end
- end)
- -- Постоянная проверка игроков (20 раз в секунду)
- RunService.Heartbeat:Connect(function()
- checkForPlayers()
- end)
- -- Отслеживание новых игроков
- Players.PlayerAdded:Connect(function(newPlayer)
- newPlayer.CharacterAdded:Connect(function(char)
- if char:FindFirstChild("HumanoidRootPart") then
- char.HumanoidRootPart:GetPropertyChangedSignal("Position"):Connect(function()
- checkForPlayers()
- end)
- end
- end)
- end)
- print("Скрипт активирован! Мониторинг игроков...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement