-- 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)Boost your progress in Era Of Supes with this Infinite Levels & Money Script. Instantly unlock maximum levels and endless in-game currency to purchase the best upgrades, gear, and more. Skip the grind and unlock your potential in seconds!
No comments yet. Be the first to comment!
1-- Toggle Script for CrimeHandler
2-- Press 'T' to toggle on/off
3
4local UserInputService = game:GetService("UserInputService")
5local ReplicatedStorage = game:GetService("ReplicatedStorage")
6
7local CrimeHandler = ReplicatedStorage:WaitForChild("Events"):WaitForChild("CrimeHandler")
8
9local isToggled = false
10local connection = nil
11
12local function fireEndRescue()
13 local args = { "EndRescue", {} }
14 CrimeHandler:FireServer(unpack(args))
15end
16
17local function toggleLoop()
18 isToggled = not isToggled
19
20 if isToggled then
21 -- Start the loop
22 print("Script Activated")
23 connection = game:GetService("RunService").Heartbeat:Connect(fireEndRescue)
24 else
25 -- Stop the loop
26 print("Script Deactivated")
27 if connection then
28 connection:Disconnect()
29 connection = nil
30 end
31 end
32end
33
34UserInputService.InputBegan:Connect(function(input, gameProcessed)
35 -- Check if the key pressed was 'T' and the player isn't typing in chat
36 if input.KeyCode == Enum.KeyCode.T and not gameProcessed then
37 toggleLoop()
38 end
39end)