local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("T3LargeEnemyDeleted")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
game.StarterGui:SetCore("SendNotification", {
Title = "Made by misinformer",
Text = "Press E to toggle",
Duration = 5,
})
local isRunning = false
local runThread = nil
local function startFiring()
isRunning = true
runThread = task.spawn(function()
while isRunning do
remoteEvent:FireServer()
task.wait()
end
end)
end
local function stopFiring()
isRunning = false
if runThread then
task.cancel(runThread)
runThread = nil
end
end
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.E and not gameProcessed then
if isRunning then
stopFiring()
else
startFiring()
end
end
end)
Comments
No comments yet
Be the first to share your thoughts!