https://[Log in to view URL]
getgenv().notify = true
getgenv().highlightdestroy = true
getgenv().damage = 9e9
getgenv().damageVehiclesLoop = false
function checkgun()
local tool = game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Tool")
return tool
end
function getpaint(car)
return car.PrimaryPart or car:FindFirstChildWhichIsA("BasePart")
end
function DamageAllVehicles()
local gunTool = checkgun()
if not gunTool then
game.StarterGui:SetCore("SendNotification", {
Title = "❗️",
Text = "You need to equip a gun!"
})
return
end
for _, car in ipairs(workspace:WaitForChild("CivCars"):GetChildren()) do
if getgenv().notify then
Rayfield:Notify({
Title = "Damaged All Cars.",
Content = car.Name .. " was damaged!",
Duration = 3,
Image = "rewind",
})
end
if getgenv().highlightdestroy then
local highlight = Instance.new("Highlight")
highlight.FillColor = Color3.fromRGB(255, 0, 0)
highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
highlight.Parent = car
game.Debris:AddItem(highlight, 2)
end
local targetPart = getpaint(car)
if targetPart then
game:GetService("ReplicatedStorage").InflictCar:InvokeServer(
gunTool,
car,
targetPart,
getgenv().damage
)
end
end
end
local Toggle = MiscTab:CreateToggle({
Name = "Damage All Vehicles Loop",
CurrentValue = false,
Flag = "DamageVehiclesToggle",
Callback = function(state)
getgenv().damageVehiclesLoop = state
if state then
spawn(function()
while getgenv().damageVehiclesLoop do
DamageAllVehicles()
wait(1)
end
end)
end
end,
})
To embed this project on your website, copy the following code and paste it into your website's HTML: