Documentation

Config

Explanations and examples for the current angle grinder configuration.

Edit zyke_anglegrinder/shared/unlocked/config.lua. Distances are metres, durations ending in Ms are milliseconds, and durability and charge run from 0 to 100.

Keybinds can be changed in GTA / FiveM settings. Framework, inventory, target, and webhook settings live in zyke_lib. What can be cut, and how hard each cut is, is decided by the resource that offers it; see Integrations.

#Full Default Config

#Config.Settings.grinder

#enabled

Enables the resource's items. When disabled, the grinder, disc, and battery items are not registered as usable and the missing-item check is skipped.

Example:

lua
enabled = true

#item

The grinder item. Using it takes the grinder out or puts it away. Keep it non-stackable/unique.

Example:

lua
item = "anglegrinder"

#discItem

The standard disc. Using it with the grinder out fits it to an empty grinder. It wears at the base rate and returns as brokenDiscItem when spent. Starter grinders get this disc.

Example:

lua
discItem = "anglegrinder_disc"

#discs

Further disc tiers, keyed by item name. wearMultiplier scales the disc's wear for every integration, so 0.5 lasts twice as long as the standard disc. brokenItem is what a spent disc returns as; false destroys it.

models and images set the held prop and inventory icon for each state: loaded, broken, loadedNobatt, and brokenNobatt. States without an entry use prop.models and images. Every disc listed here is registered as usable, and its item must exist in your inventory.

Example:

lua
discs = {
    anglegrinder_disc_pro = {
        wearMultiplier = 0.5,
        brokenItem = "anglegrinder_disc_pro_broken",
        models = {loaded = "zyke_anglegrinder_pro", broken = "zyke_anglegrinder_pro_broken", loadedNobatt = "zyke_anglegrinder_pro_nobatt", brokenNobatt = "zyke_anglegrinder_pro_broken_nobatt"},
        images = {loaded = "anglegrinder_pro", broken = "anglegrinder_pro_broken", loadedNobatt = "anglegrinder_pro_nobatt", brokenNobatt = "anglegrinder_pro_broken_nobatt"},
    },
}

#brokenDiscItem

Item a spent standard disc returns as when it is ejected. Set to false to destroy spent discs instead.

Example:

lua
brokenDiscItem = "anglegrinder_disc_broken"

#batteryItem

The battery item. Using it with the grinder out attaches it to a grinder that has none. While set, the grinder needs a fitted, charged battery to run. Set to false or "" to remove batteries entirely: grinders then need no battery, keep their battery look, and recharging is unavailable.

Example:

lua
batteryItem = "anglegrinder_battery"

#batteryDrain

Charge drained per wear roll, as a flat number or a {min, max} range. A grind spreads its rolls across its cuts, and a clean grind drains about half of one roll. Cutting outside the zone drains more. 0 means a fitted battery never runs out.

Example:

lua
batteryDrain = {min = 1, max = 3}

#durabilityLoss

Disc wear range used when the caller passes none, such as StartGrind, /grindtest, and WearGrinderDisc. A clean pressure cut wears half of the rolled amount, and the disc's wearMultiplier applies on top. Integrations that open their own server sessions pass their own range.

Example:

lua
durabilityLoss = {min = 8, max = 20}

#starterItems

Parts fitted to every new grinder, vendor purchases included. Each entry accepts false to leave the part out, true or a number for a stock part, or {durability = n} for a set durability. A disc at 0 fits as broken. battery only applies while batteryItem is set.

Example:

lua
starterItems = {
    disc = {durability = 100},
    battery = {durability = 100},
}

#prop

Hand bone, offset, and rotation of the held grinder, and the model for each state. The Nobatt models are used while batteryItem is set and no battery is attached. The models are streamed by the resource.

Example:

lua
prop = {
    bone = 57005,
    offset = {x = 0.144, y = 0.101, z = 0.012},
    rotation = {x = 34.993, y = 1.41, z = -1.379},
    models = {
        empty = "zyke_anglegrinder_empty",
        loaded = "zyke_anglegrinder",
        broken = "zyke_anglegrinder_broken",
        emptyNobatt = "zyke_anglegrinder_empty_nobatt",
        loadedNobatt = "zyke_anglegrinder_nobatt",
        brokenNobatt = "zyke_anglegrinder_broken_nobatt",
    },
}

#images

Inventory icon written to the grinder's image metadata for each state of the standard disc. The file names match the icons in extras/items/images/256/.

Example:

lua
images = {
    empty = "anglegrinder_empty",
    loaded = "anglegrinder",
    broken = "anglegrinder_broken",
    emptyNobatt = "anglegrinder_empty_nobatt",
    loadedNobatt = "anglegrinder_nobatt",
    brokenNobatt = "anglegrinder_broken_nobatt",
}

#Grinding

Settings under Config.Settings.grinder.grinding control how every grind plays, looks, and sounds. Each integration still decides its own stages and disc wear. See Pressure Cut.

#grinding.minigame

"pressure" runs the pressure cut. "skillcheck" runs each stage's zyke_lib skill checks and progress bar instead.

Example:

lua
minigame = "pressure"

#grinding.pressure.keys

Keys that push the disc in while held. They are read as GTA controls, so each follows the player's own GTA key binding.

Example:

lua
keys = {"LEFTMOUSE", "E", "SPACE"}

#grinding.pressure.secondsPerCheck

Seconds each skill check preset in an integration's stage adds to the cut. The stage's own seconds are added on top.

Example:

lua
secondsPerCheck = 1.5

#grinding.pressure.penalty

How many times faster the disc wears outside the zone, where nothing is cut. It applies whether the player pushes too hard or lets go.

Example:

lua
penalty = 6.0

#grinding.pressure.graceSeconds

Seconds at the start of each cut where being outside the zone costs nothing, to find the zone.

Example:

lua
graceSeconds = 2.0

#grinding.pressure.golden

Golden band in the middle of the zone. size is its share of the zone's width and speed how many times faster both the cut and the wear run inside it, so a clean cut wears the same but ends sooner. Set to false to disable.

Example:

lua
golden = {size = 0.25, speed = 1.5}

#grinding.pressure.difficulties

zone is the zone's width and drift how far it wanders, both as a share of the gauge. length multiplies the cut's time. The hardest preset a stage lists picks its difficulty, and stages without checks use easy.

Example:

lua
difficulties = {
    easy = {zone = 0.20, drift = 0.10, length = 3.75},
    medium = {zone = 0.15, drift = 0.16, length = 4.875},
    hard = {zone = 0.10, drift = 0.22, length = 6.375},
}

#grinding.anim

Work animation held through the minigame. flag = 49 plays it on the upper body, and 1 plays a full-body animation. crouch crouches the player unless the integration decides. reach places the player that many metres from the grind point, facing it. The first grind measures where the animation really holds the disc and corrects the spot. Preview animations with /grindpose.

Example:

lua
anim = {dict = "zyke_anglegrinder_grind", clip = "grind_loop", flag = 49, crouch = true, reach = 0.66}

#grinding.grip

Grip on the held grinder while grinding, in the same hand-bone space as prop. false keeps the held grip. Tune it live with /grindprop during /grindpose, which prints the values to paste here.

Example:

lua
grip = {
    offset = {x = -0.029, y = -0.091, z = -0.138},
    rotation = {x = 173.765, y = 128.421, z = -76.805},
}

#grinding.cinematic

Close-up camera on the disc while the minigame runs. camera and look are metres from the grind point: x to the player's right, y toward the point, and z up. fov is degrees. Set enabled = false to keep the gameplay camera for every grind, whatever an integration asks for. An integration can opt out or frame its own shot per target.

Example:

lua
cinematic = {
    enabled = true,
    camera = {x = -1.5, y = -0.55, z = 0.75},
    look = {x = 0.0, y = -0.2, z = 0.25},
    fov = 32.0,
    blendInMs = 1000,
    blendOutMs = 800,
}

#grinding.sparks

Sparks thrown off the disc edge, seen by every nearby player and scaled by how hard the disc bites. The first effect the game build supports is used; build is the lowest build that has it. The Tuners sparks need game build 2372 or newer, and ent_brk_sparking_wires is the fallback. Set to false to disable.

Example:

lua
sparks = {
    effects = {
        {
            asset = "scr_tn_tr", name = "scr_tn_tr_angle_grinder_sparks", build = 2372,
            offset = {x = -0.089, y = 0.225, z = 0.002},
            rotation = {x = 0.0, y = 0.0, z = 49.9},
        },
        {asset = "core", name = "ent_brk_sparking_wires"},
    },
    offset = {x = 0.0, y = 0.268, z = -0.074},
    rotation = {x = 0.0, y = 0.0, z = 0.0},
    scale = 1.0,
}

#grinding.sound

Motor sound through Sounds, played on the grinding player for everyone within distance: a spin-up, a grind or cut loop that follows the pressure, and a spin-down. Each entry is a zyke_sounds file path; false leaves that part silent.

Example:

lua
sound = {
    enabled = true,
    start = "tools/anglegrinder_start.ogg",
    grind = "tools/anglegrinder_grind.ogg",
    cut = "tools/anglegrinder_cut.ogg",
    stop = "tools/anglegrinder_stop.ogg",
    volume = 0.5,
    distance = 35.0,
}

#grinding.spinDown

Seconds the disc keeps spinning after every grind. Until it stops, blockUnequip keeps the grinder out and blockVehicle keeps the player out of vehicles. seconds matches tools/anglegrinder_stop.ogg, so change it along with the stop sound. 0 turns the spin-down off.

Example:

lua
spinDown = {
    seconds = 5.2,
    blockUnequip = true,
    blockVehicle = true,
}

#grinding.moveTolerance

Walking further than this from where the grind started cancels it.

Example:

lua
moveTolerance = 0.75

#grinding.approachTimeout

Milliseconds the walk to an integration's grinding spot may take before it gives up.

Example:

lua
approachTimeout = 8000

#Witnesses

NPC witnesses for illegal grinds. Each integration says whether its grind is legal. A witnessed grind calls OnIllegalGrind in server/unlocked/hooks.lua once per session. See Police Alerts & Logging.

#witnesses.enabled

Enables witness checks.

Example:

lua
enabled = true

#witnesses.debug

Prints witness check results to the console.

Example:

lua
debug = false

#witnesses.maxDistance

Furthest a ped or driven vehicle can be to notice a grind. Integrations can override it per grind.

Example:

lua
maxDistance = 40.0

#witnesses.fieldOfView

Sight cone in degrees for peds on foot.

Example:

lua
fieldOfView = 60.0

#witnesses.vehicleFieldOfView

Sight cone in degrees for drivers.

Example:

lua
vehicleFieldOfView = 120.0

#witnesses.hearingDistance

Peds this close notice the grind without line of sight. Set to false to disable.

Example:

lua
hearingDistance = 8.0

#witnesses.defaultLegal

Used when an integration does not say whether its grind is legal. false treats those grinds as illegal.

Example:

lua
defaultLegal = false

#witnesses.recheckInterval

Milliseconds between checks during a long grind. 0 checks only when the disc starts.

Example:

lua
recheckInterval = 5000

#witnesses.blacklistedModels

Ped models that never count as witnesses.

Example:

lua
blacklistedModels = {"s_m_y_cop_01"}

#Keybinds & Interest Points

#keys

Default keys for the player-remappable keybinds. use cuts the interest point the player aims at, unequip puts the grinder away, and menu opens the grinder menu. R doubles as reload and light melee, which stay suppressed while the grinder is out. Players rebind them under Esc > Settings > Key Bindings > FiveM.

Example:

lua
keys = {
    use = {key = "E", keyType = "keyboard"},
    unequip = {key = "X", keyType = "keyboard"},
    menu = {key = "R", keyType = "keyboard"},
}

#points.enabled

Shows a dot on everything an integration lets the grinder cut while it is out. The use key only cuts an aimed dot, so with false nothing can be cut with the use key.

Example:

lua
enabled = true

#points.renderDistance

Metres from the player within which dots are drawn.

Example:

lua
renderDistance = 8.0

#points.aimRadius

Pixels at 1080p a dot can be from the screen centre and still count as aimed at. The closest dot to the crosshair wins.

Example:

lua
aimRadius = 70

#instructions.position

Where the keybind panel sits while the grinder is out: "bottom-right", "bottom-center", or "bottom-left". During a cut, the minigame keys always sit centred under the minigame.

Example:

lua
position = "bottom-right"

#Hardware Supplier

Settings under Config.Settings.grinder.vendor. Item entries use item names, so renamed items need their entries updated too. See Hardware Supplier.

#vendor.enabled

Enables the vendor peds.

Example:

lua
enabled = true

#vendor.recharge

Battery recharging at every vendor. seconds is the progress bar length, price is flat per recharge, and chargeAmount is the percent restored, capped at 100. Use 100 for a full recharge or a lower value for top-ups.

Example:

lua
recharge = {enabled = true, seconds = 8, price = 100, chargeAmount = 100}

#vendor.wornShare

Share of the vendor's own selling price paid for a used disc at 100% durability. The price drops evenly to the disc's broken item buyback price at 0%.

Example:

lua
wornShare = 0.8

#vendor.positions

Vendor peds. Capture coords where a player stands, with w as the ped's heading; the ped is lowered onto the ground under it. scenario is the idle scenario. Remove blip to hide the map marker. Players must stay within 5 metres of coords to trade.

Example:

lua
positions = {
    {
        label = "Hardware Supplier",
        model = "s_m_m_gentransport",
        coords = vec4(2749.5903320312, 3477.5495605469, 55.671844482422, 193.44876098633),
        scenario = "WORLD_HUMAN_CLIPBOARD",
        blip = {sprite = 52, color = 0, scale = 0.7},
        items = {
            {name = "anglegrinder", price = 500},
            {name = "anglegrinder_disc", price = 50},
            {name = "anglegrinder_disc_pro", price = 100},
            {name = "anglegrinder_disc_elite", price = 200},
            {name = "anglegrinder_battery", price = 100},
        },
        buyback = {
            {name = "anglegrinder_disc_broken", price = 10},
            {name = "anglegrinder_disc_pro_broken", price = 10},
            {name = "anglegrinder_disc_elite_broken", price = 10},
        },
        wornBuyback = {
            {name = "anglegrinder_disc"},
            {name = "anglegrinder_disc_pro"},
            {name = "anglegrinder_disc_elite"},
        },
    },
}

#vendor.positions.<vendor>.items

Items the vendor sells, with the price of one piece. Add label to override the item's label. Players buy up to 20 at a time, paid from cash first and bank otherwise.

Example:

lua
items = {
    {name = "anglegrinder", price = 500},
    {name = "anglegrinder_disc", price = 50},
    {name = "anglegrinder_battery", price = 100},
}

#vendor.positions.<vendor>.buyback

Items the vendor buys back, paid in cash per piece.

Example:

lua
buyback = {
    {name = "anglegrinder_disc_broken", price = 10},
}

#vendor.positions.<vendor>.wornBuyback

Used discs the vendor buys back by durability, priced by wornShare from the disc's price in this vendor's items. Each stack is sold at its own price.

Example:

lua
wornBuyback = {
    {name = "anglegrinder_disc"},
    {name = "anglegrinder_disc_pro"},
}