Spike strip script for FiveM that only bursts the tires that are touching the spikes.
Showcase: https://www.youtube.com/watch?v=iarfWQxAMAg
Changes from V1
- Better performance
- Now supports more tires (previously only 4). This makes it work correctly on e.g a Dubsta 6x6
- Audio when placing a spike strip
- Target inteaction to pick up spike strips
- Option to spawn entities on the server or locally
- Animation when picking up
- Better support for frameworks
- Version checking
- Logs
- A bunch of quality of life features
- /clearspikestrips admin command to clear all spike strips
- Notifications
- Automatically delete after a certain time
- Delete on script stop
- Option to only allow placing on roads
- And a lot more
6 spikestrips placed, Config.BurstNPC
disabled:
- not in a vehicle: 0.00ms
- in a vehicle: 0.01ms
- in a vehicle, very close: 0.03-0.06ms
6 spikestrips placed, Config.BurstNPC
enabled with NPC's driving over:
- not in a vehicle: 0.03-0.04ms
- in a vehicle: 0.05ms
- in a vehicle, very close: 0.08ms
- Download the latest release
- Install all dependencies
- Add the item to your server
- Configure the script to your liking
- Add
ensure loaf_spikestrips
to your server.cfg - Either restart your server, or start the resource by running
refresh
and thenensure loaf_spikestrips
in your server console
If you use esx_policejob, you can remove the built in functionality by removing p_ld_stinger_s
from the table in the -- Enter / Exit entity zone events
thread in esx_policejob/client/main.lua
.
If you use qb-policejob, you can remove the built in functionality by removing the thread in qb-policejob/client/object.lua
that handles the spike strip.
You can use the included spikestrip.png
as the item image.
Default ESX
Run the following query in your database:INSERT INTO `items` (`name`, `label`, `weight`) VALUES ("spikestrip", "Spike strip", 500);
ox_inventory
Add to ox_inventory/data/items.lua:["spikestrip"] = {
label = "Spike strip",
weight = 500,
stack = true
}
qb-inventory
Add to qb-core/shared/items.lua:spikestrip = { name = 'spikestrip', label = 'Spike strip', weight = 500, type = 'item', image = 'spikestrip.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = 'Useful for stopping the bad guys' },
Config.SpawnMethod - The method used to spawn the spike strip. This can be one of the following:
Value | Description |
---|---|
"local" |
The spike strip entity is spawned locally on each client, and deleted when out of view. |
"networked" |
The entity is spawned networked by the person who places it |
"server" |
The entity is spawned by the server |
The script supports logging via Discord webhooks or ox_lib.
If you wish to use ox_lib, set Config.LogSystem
to "ox_lib"
. For discord, set it to "discord"
and set your webhook in loaf_spikestrips/server/logs.lua