Is it possible to have it enabled and disabled via command, and work for all vehicles? (So don’t have to manually put every car in the whitelist?) EDIT: I should really read better… I see you have the command to disable it, is it possible to have the option to be disabled for everything unless the command is run first?
Does the ‘explosion’ sound trigger NPCs to flee/become aggressive? I have seen this happen with previous 2step ALS scripts
Hey, yes you can turn off the functionality via the command /antilag. With the same command you can also turn it back on again. Making it work for all vehicles is easily possible editing the following code, just replace the CreateThread part:
CreateThread(function()
while true do
local sleep = 1000
local player = PlayerPedId()
local veh = GetVehiclePedIsIn(player, false)
local vehiclePos = GetEntityCoords(veh)
local delay = math.random(25, Config.explosionSpeed)
if GetPedInVehicleSeat(GetVehiclePedIsIn(PlayerPedId()), -1) == player and isAntiLagEnabled then
sleep = 0
local RPM = GetVehicleCurrentRpm(veh, player)
local gear = GetVehicleCurrentGear(veh)
if gear ~= reverse then
if not IsControlPressed(1, 71) and not IsControlPressed(1, 72) then
if RPM > Config.RPM then
TriggerServerEvent("flames", VehToNet(veh))
AddExplosion(vehiclePos, 61, 0.0, true, true, 0.0, true)
Wait(delay)
end
end
end
end
Wait(sleep)
end
end)
regarding the NPCs running everywhere when the “explosion” happens… That is something that I can look into, good suggestion. Thank you!
From memory, I think a previous script creator was looking at using natives to make peds ignore the player while the explosions sounded (probably in your …if RPM > Config.RPM then… section)
this will make the peds ignore the sound it is using some ms but will work. nice script i have been using this for weeks now before you even posted it here.
local effectsEnabled = true
function triggerPedestrianEffects()
if effectsEnabled then
print(“Pedestrians are scared away!”)
else
print(“Pedestrians are not affected.”)
end
end
function togglePedestrianEffects()
effectsEnabled = not effectsEnabled
if effectsEnabled then
print(“Pedestrian effects are now enabled.”)
else
print(“Pedestrian effects are now disabled.”)
end
end
while true do
local playerInput = getPlayerInput() – Replace with actual input retrieval logic
if playerInput == “toggle_pedestrian_effects” then
togglePedestrianEffects()
elseif playerInput == “trigger_pedestrian_effects” then
triggerPedestrianEffects()
else
------- Handle other game logic ---------
end
end
With the most recent script update that I did the peds also don’t get scared because of the custom sounds, so the code you posted does not apply anymore for my script
I like it mate keep up the good work. There is one there who trynda sell this script, shame on him, trying to get free scripts that add a lot of joy on servers and try to make profit out of them
Yeah I saw that, tbh im just here to share some nice resources for the community to use and improve my own coding skills. I don’t really want to get involved in that kind of drama. just here for a good time