-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] local Rayfield = loadstring(game:HttpGet("https://sirius.menu/gen2"))() local window = Rayfield:CreateWindow({ name = "Anti Guard", subtitle = "reset on guard nearby", }) local tab = window:CreateTab({ name = "Home", icon = 4483362458 }) ------------------------------------------------- -- CONFIGURATION ------------------------------------------------- local TEAM_NAME = "Guards" local TRIGGER_DISTANCE = 30 ------------------------------------------------- local Players = game:GetService("Players") local RunService = game:GetService("RunService") local localPlayer = Players.LocalPlayer local enabled = false local connection = nil local onCooldown = false local function getRoot(player) local char = player.Character if not char then return nil end return char:FindFirstChild("HumanoidRootPart") end tab:CreateToggle({ name = "Auto Reset on Guard Nearby", currentValue = false, callback = function(state) enabled = state if enabled then connection = RunService.Heartbeat:Connect(function() if onCooldown then return end local myRoot = getRoot(localPlayer) if not myRoot then return end for _, player in ipairs(Players:GetPlayers()) do if player == localPlayer then continue end if not player.Team then continue end if player.Team.Name ~= TEAM_NAME then continue end local theirRoot = getRoot(player) if not theirRoot then continue end -- skip dead guards local theirHum = player.Character:FindFirstChildOfClass("Humanoid") if not theirHum or theirHum.Health <= 0 then continue end local distance = (myRoot.Position - theirRoot.Position).Magnitude if distance <= TRIGGER_DISTANCE then print("Guard nearby: " .. player.Name .. " — resetting!") onCooldown = true local char = localPlayer.Character if char then local hum = char:FindFirstChildOfClass("Humanoid") if hum then hum:ChangeState(Enum.HumanoidStateType.Dead) end end task.wait(3) onCooldown = false return end end end) else if connection then connection:Disconnect() connection = nil end onCooldown = false end end, }) tab:CreateSection("Configuration") tab:CreateSlider({ name = "Trigger Distance (studs)", range = { 5, 100 }, increment = 1, currentValue = TRIGGER_DISTANCE, flag = "TriggerDistance", callback = function(v) TRIGGER_DISTANCE = v end, }) tab:CreateInput({ name = "Team Name", placeholderText = "Guards", removeTextAfterFocusLost = false, flag = "TeamName", callback = function(v) if v ~= "" then TEAM_NAME = v end end, }) tab:CreateButton({ name = "Debug: Print All Player Teams", callback = function() local myRoot = getRoot(localPlayer) if not myRoot then print("no root") return end for _, player in ipairs(Players:GetPlayers()) do if player == localPlayer then continue end local theirRoot = getRoot(player) if not theirRoot then print(player.Name .. " has no root") continue end local dist = (myRoot.Position - theirRoot.Position).Magnitude print(player.Name, "| Distance:", dist, "| Team:", player.Team and player.Team.Name or "nil") end end, })