-- Toggle Script for CrimeHandler -- Press 'T' to toggle on/off local UserInputService = game:GetService("UserInputService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local CrimeHandler = ReplicatedStorage:WaitForChild("Events"):WaitForChild("CrimeHandler") local isToggled = false local connection = nil local function fireEndRescue() local args = { "EndRescue", {} } CrimeHandler:FireServer(unpack(args)) end local function toggleLoop() isToggled = not isToggled if isToggled then -- Start the loop print("Script Activated") connection = game:GetService("RunService").Heartbeat:Connect(fireEndRescue) else -- Stop the loop print("Script Deactivated") if connection then connection:Disconnect() connection = nil end end end UserInputService.InputBegan:Connect(function(input, gameProcessed) -- Check if the key pressed was 'T' and the player isn't typing in chat if input.KeyCode == Enum.KeyCode.T and not gameProcessed then toggleLoop() end end)