local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local player = Players.LocalPlayer local DEATH_EQUIP_DELAY = 0.00067 local POST_DEATH_WAIT = 0.15777777 local firing = false local deadLoopActive = false -- Equip a tool local function equipTool(tool) if tool and tool:IsA("Tool") and player.Character then local humanoid = player.Character:FindFirstChildOfClass("Humanoid") if humanoid then humanoid:EquipTool(tool) end end end -- Find all tools by name (case-insensitive) local function findToolsByName(name) local backpack = player:WaitForChild("Backpack") local toolsFound = {} for _, tool in ipairs(backpack:GetChildren()) do if tool:IsA("Tool") and tool.Name:lower() == name:lower() then table.insert(toolsFound, tool) end end return toolsFound end -- Fire C4Drop repeatedly while dead local function fireC4Loop() local remote = ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("Miscs"):WaitForChild("C4Drop") while firing do remote:FireServer() task.wait(DEATH_EQUIP_DELAY) end end -- Loop to equip all tools infinitely while dead local function equipLoop(tools) while deadLoopActive do for _, tool in ipairs(tools) do if not deadLoopActive then break end equipTool(tool) task.wait(DEATH_EQUIP_DELAY) end end end -- Handle death local function handleDeath() task.wait(POST_DEATH_WAIT) -- wait before doing anything local c4Tools = findToolsByName("C4") if #c4Tools == 0 then c4Tools = findToolsByName("c4") end local toolsToLoop = {} if #c4Tools > 0 then toolsToLoop = c4Tools else print("C4/c4 item hasn't been found, Switching to every item") toolsToLoop = player:WaitForChild("Backpack"):GetChildren() end deadLoopActive = true firing = true -- Start loops in parallel spawn(function() equipLoop(toolsToLoop) end) spawn(fireC4Loop) end -- Handle respawn / character events local function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") -- Stop loops if respawned humanoid:GetPropertyChangedSignal("Health"):Connect(function() if humanoid.Health > 0 then deadLoopActive = false firing = false end end) -- When the player dies humanoid.Died:Connect(function() handleDeath() end) end -- Connect character events player.CharacterAdded:Connect(onCharacterAdded) if player.Character then onCharacterAdded(player.Character) end