Slash Tires
Showcase
Preview video (YouTube)
A short video (40 seconds) that shows me slashing the tires standing up, crouching, using a controller (see the top left) and using the targeting solution qTarget. There are some other features that aren’t directly shown, however, it sums the script up in a neat little video.
*Edit: RIB SOSAY (known as @ronnie5gt on the forums) made a short video showing the script in a much cooler way than I ever could. You can watch the video here on Youtube.
About
Slash Tires is a standalone script that allows players to slash the tires of vehicles with the use of any sharp weapon (can be configured). It is highly configurable which allows you to configure it to your needs and wants, including the disabled slashing of tires on emergency and/or specified vehicle models. Additionally, it uses fivem’s inbuilt key mapping system to allow players to customize their key binds, for both keyboard and controllers. Furthermore, it supports ox_target, qTarget, qb-target and bt-target if enabled in the config file. It also has server-sided checks to prevent abuse (because f*** cheaters), and can easily be translated to other languages if you so desire. On top of all of this, you can freely edit the source code to your heart’s content.
I have been testing the script for quite a while, so there shouldn’t be any bugs or problems. However, if you find any bugs, report them and I’ll fix them ASAP!
Key Features
- Tire slashing (duh)
- Highly configurable (See Configuration)
- Key mapping (custom key binds) for both keyboard and controllers
- Supports ox_target, qTarget, qb-target and bt-target
- Optimized (0.00-0.04ms)
- Localization; You can easily translate or change the text in the locales folder!
- Server-side checks to prevent abuse.
Configuration
The script is highly configurable, click below to see the full config file.
Config.lua
Config = {}
-- If you have a cool suggestion or if anything is unclear please leave a comment on the forum post :D
-- The targeting solution (3rd eye) to use (if you don't want to use any then either just use the /slashtire command or set Config.HelpText to 'auto'/whatever system you use)
-- false : Don't use any targeting solution.
-- 'ox_target' : ox_target by the overextended team and its many other contributors. (https://github.com/overextended/ox_target)
-- 'qb-target' : qb-target by BerkieBb and its many other contributors. (https://github.com/BerkieBb/qb-target)
-- 'qtarget' : qtarget by Linden (thelindat), Noms (OfficialNoms) and its many other contributors. (https://github.com/overextended/qtarget)
-- 'bt-target' : bt-target by brentN5 (https://github.com/brentN5/bt-target). I advise against using this option due to how old it is.
-- 'auto' : auto detect a target system, defaults to false if no supported scripts was found
Config.Target = 'auto'
-- The icon that will be shown beside the text when using the 3rd eye. Only used if any of the targeting solutions are enabled.
Config.TargetIcon = 'fas fa-hand-scissors'
-- The system we should use for the help text/prompt system if wanted
-- false : Don't use any help text/prompt system.
-- 'ox' : ox_lib's text ui module (make sure to include '@ox_lib/init.lua' in the fxmanifest)
-- 'qb' : QBCore's DrawText export
-- 'esx' : ESX's ShowHelpNotification (basically the same same as standalone but trough esx)
-- 'standalone' : Using gta natives to show a help text in the top right
-- 'auto' : auto detect a supported help text system, defaults to standalone if no supported scripts was found
Config.HelpText = 'auto'
-- The default keybind for keyboard, leave it empty ('') for no default.
Config.DefaultKey = 'E'
-- The default button for controllers, see possible controls here: https://github.com/citizenfx/fivem-docs/blob/master/content/docs/game-references/input-mapper-parameter-ids/pad_analogbutton.md
Config.DefaultPadAnalogButton = 'L2_INDEX' -- Left Trigger
-- What framework to use. Supported "frameworks" and what they are used for:
-- 'ox' : Uses OX oriented player states (client/server) and ox_lib's logger function (server) (make sure to include '@ox_lib/init.lua' in the fxmanifest)
-- 'qb' : Uses QB player metadata (client/server) and qb-log event (server)
-- 'esx' : Uses ESX player data (client), ESX oriented player states (server) and ESX discord log (server)
-- 'nd' : ND_core, uses lib.logger (ox_lib) and player states (not tested)
-- 'standalone' : Uses gta natives as checks and prints the log to the server console
-- 'auto' : Attempts to auto detect a framework, defaults to standalone if no supported scripts was found
Config.Framework = 'auto'
-- 'ox' : ox_inventory or any that can provide for it
-- 'qb' : qb-inventory or a framework that supports qbcore inventory related functions
-- 'esx' : ESX core inventory
-- 'standalone' : Standalone checking, uses gta 5 natives where possible
-- 'auto' : Attempts to auto detect a supported inventory script, defaults to standalone if no supported scripts was found
Config.Inventory = 'auto'
-- 'ox' : ox_lib's notifications
-- 'qb' : QB notifications (event)
-- 'esx' : ESX notifications
-- 'standalone' : GTA natives (shows notif above the minimap)
-- 'auto' : Attempts to auto detect a notification script, defaults to standalone if no supported scripts was found
Config.Notification = 'auto'
-- false : No dispatch alerts
-- 'ps' : ps-dispatch by Project Sloth
-- 'nd' : Dispatch alerts for ND_MDT for ND_core
-- 'ox' : Bridge for ox_mdt
-- 'core' : Bridge for core_dispatch
-- 'rcore' : Bridge for rcore_dispatch
-- 'quasar' : Bridge for qs-dispatch (This has not been tested)
-- 'auto' : Attempts to auto detect a supported dispatch/mdt script. Defaults to false if none was found.
Config.Dispatch = 'auto'
-- The % chance to give an alert if there is a NPC nearby that observes the slashing
Config.DispatchAlertChance = 25.0 -- 25%
-- The language localization to load, add your own to the locales folder if needed!
-- Avalible ones per now is: 'en' (english) and 'no' (norwegian bokmål)
Config.Language = 'en'
-- The maximum distance from the player you want it to detect tires, this allows for the Config.Lang.TooFar message to be shown between this and Config.MaxTireInteractionDist.
Config.MaxTireDetectionDist = 2.0
-- The maximum distance from the tire the player can be for it to allow them to interact with it.
Config.MaxTireInteractionDist = 1.2
-- The animtion used when slashing a tire
Config.SlashTireAnimation = {
Dict = 'melee@knife@streamed_core_fps',
Name = 'ground_attack_on_spot'
}
-- How the script should handle bulletproof tires.
-- Options:
-- ignore: Ignores whether or not the tire is bulletproof. However, bulletproof tires will never go down to the rim, and only ever be "deflated".
-- limit: Allows the weapons with the canSlashBulletProof parameter set to true to puncture bulletproof tires.
-- proof: Makes the bulletproof tires slash proof.
Config.BulletproofSetting = 'ignore'
-- If the script should attempt to make the player ped face the tire or not.
Config.DoFaceCoordTask = true
-- Check if the player is doing the animation before slashing the tire, times out (stops the slashing attempt) after 3 seconds.
-- This is supposed to make the animation and burst of the tire to be more synchronous.
Config.DoAnimationCheckLoop = true
-- If true it makes all the npc's close by react and flee from the player when they slash a tire.
Config.AIReactAndFlee = true
-- All AI peds within this distance will react and flee from the player when he/she slashes a tire. (if Config.AIReactAndFlee is set to true)
Config.AIReactionDistance = 10.0
-- If enabled, adds help text to the /slashtire command. This is designed to work with fivem's default chat resource.
Config.AddChatSuggestion = true
-- Toggle whether or not to have a chance of weapons breaking.
-- You may need to add some code yourself (trigger an event or export) if you are using this in combination with an inventory script that has weapons as items. See the removeWeapon function in server.lua
Config.CanWeaponsBreak = true
-- If the item (weapon) used to slash a tire should get reduced durability
Config.ReducedItemDurability = true
-- A list of the hashes of the weapons that can be used to slash tires.
Config.AllowedWeapons = {
[`weapon_knife`] = {
name = 'weapon_knife', -- The name of the weapon, only used if you want to setup stuff for inventory scripts
breakChance = 8, -- The % chance for the weapon to break, this is only used if Config.CanWeaponsBreak is set to true. Values must be between 0 and 100, 0 = never break. 100 = always break.
durability = 10.0, -- The amount of durability to remove when the weapon is used to slash a tire (for this to work Config.ReducedItemDurability needs to be set to true and the framework/inventory script needs to support durability!)
canSlashBulletProof = false -- If this weapon can slash bulletproof tires when Config.BulletproofSetting is set to 'limit'
},
[`weapon_hammer`] = {
name = 'weapon_hammer',
durability = 10.0,
breakChance = 15
},
[`weapon_crowbar`] = {
name = 'weapon_crowbar',
durability = 10.0,
breakChance = 10
},
[`weapon_bottle`] = {
name = 'weapon_bottle',
durability = 25.0,
breakChance = 20
},
[`weapon_dagger`] = {
name = 'weapon_dagger',
durability = 5.0,
breakChance = 2,
canSlashBulletProof = true
},
[`weapon_hatchet`] = {
name = 'weapon_hatchet',
durability = 10.0,
breakChance = 7
},
[`weapon_machete`] = {
name = 'weapon_machete',
durability = 10.0,
breakChance = 8
},
[`weapon_switchblade`] = {
name = 'weapon_switchblade',
durability = 8.0,
breakChance = 5
},
[`weapon_battleaxe`] = {
name = 'weapon_battleaxe',
durability = 10.0,
breakChance = 6
},
[`weapon_stone_hatchet`] = {
name = 'weapon_stone_hatchet',
durability = 10.0,
breakChance = 8
}
}
-- Whether or not to allow people to slash emergency vehicles.
Config.CanSlashEmergencyVehicles = true
-- Vehicles that can't have their tires slashed.
-- 1 = vehicle_is_blacklisted; block slashing, give generic message to player
-- 2 = tire_is_indestructible; block slashing, tell player that the tire seems indestructible
-- 3 = vehicle_is_emergency; block slashing, tell player they can't slash the tires of emergency vehicles (setting Config.CanSlashEmergencyVehicles will make all emergancy class vehicles return this reason)
-- 4 = tire_is_track; hide slashing option, tell player (if done trough command) that they can't slash tracks
-- 5 = tire_is_train_wheel; hide slashing option, tell player (if done trough command) that they can't train wheels
-- 6 = tire_is_invisible; hide slashing option, tell player (if done trough command) that there are no nearby tires to slash
Config.VehicleBlacklist = {
-- Indestructible tires (planes and helicopters)
[`akula`] = 2,
[`alkonost`] = 2,
[`annihilator`] = 2,
[`annihilator2`] = 2,
[`avenger`] = 2,
[`avenger2`] = 2,
[`avenger3`] = 2,
[`avenger4`] = 2,
[`blimp`] = 2,
[`blimp2`] = 2,
[`blimp3`] = 2,
[`bombushka`] = 2,
[`buzzard`] = 2,
[`buzzard2`] = 2,
[`cargobob`] = 2,
[`cargobob2`] = 2,
[`cargobob3`] = 2,
[`cargobob4`] = 2,
[`frogger`] = 2,
[`frogger2`] = 2,
[`howard`] = 2,
[`hunter`] = 2,
[`maverick`] = 2,
[`microlight`] = 2,
[`pyro`] = 2,
[`savage`] = 2,
[`seabreeze`] = 2,
[`skylift`] = 2,
[`swift`] = 2,
[`swift2`] = 2,
[`tula`] = 2,
[`volatol`] = 2,
[`volatus`] = 2,
-- Indestructible tires (other vehicles)
[`apc`] = 2,
[`blazer4`] = 2,
[`cerberus`] = 2,
[`cerberus2`] = 2,
[`cerberus3`] = 2,
[`deathbike2`] = 2,
[`dukes2`] = 2,
[`halftrack`] = 2,
[`insurgent`] = 2,
[`insurgent2`] = 2,
[`insurgent3`] = 2,
[`kuruma2`] = 2,
[`marshall`] = 2,
[`menacer`] = 2,
[`monster`] = 2,
[`monster3`] = 2,
[`monster4`] = 2,
[`monster5`] = 2,
[`nightshark`] = 2,
[`paragon2`] = 2,
[`pounder2`] = 2,
[`rcbandito`] = 2,
[`scramjet`] = 2,
[`tractor`] = 2,
[`trailersmall2`] = 2,
[`veto`] = 2,
[`veto2`] = 2,
[`vigilante`] = 2,
[`zhaba`] = 2,
-- Tracked vehicles
[`bulldozer`] = 4,
[`khanjali`] = 4,
[`minitank`] = 4,
[`rhino`] = 4,
[`scarab`] = 4,
[`scarab2`] = 4,
[`scarab3`] = 4,
-- Train wheels
[`freight`] = 5,
[`freight2`] = 5,
[`freightcar`] = 5,
[`freightcar2`] = 5,
[`freightcont1`] = 5,
[`freightcont2`] = 5,
[`freightgrain`] = 5,
[`metrotrain`] = 5,
[`tankercar`] = 5,
-- Fake/invisible tires
[`conada`] = 6,
[`conada2`] = 6,
[`havok`] = 6,
[`oppressor2`] = 6,
[`polmav`] = 6,
[`raketrailer`] = 6,
[`seasparrow`] = 6,
[`seasparrow2`] = 6,
[`seasparrow3`] = 6,
[`supervolito`] = 6,
[`supervolito2`] = 6,
[`thruster`] = 6,
[`valkyrie`] = 6,
[`valkyrie2`] = 6,
-- Custom
-- [`myfancycar`] = 1, -- This is an example
}
Click on them or open them in a new tab to get a better look if necessary.
Purchase on Tebex
You can purchase it here through Tebex. (5.00 USD + tax)
Some of my other scripts
[Standalone] [Paid] Sit Anywhere
[Release] Telescopes
[Standalone] Crutches
If you have any questions or suggestions feel free to post them below, and I’ll answer them as soon as I can.
Code is accessible | Yes |
Subscription-based | No |
Lines (approximately) | 500 |
Support | Yes |