π€ Silly_Bandits (RedM)
A lightweight bandit ambush script for RedM: When players enter specific spots, bandits can spawn, attack the player, and depending on the outcome (player dead / escaped / bandits defeated), appropriate messages are displayed.
Preview: Video
β¨ Features
-
π Spot-based Triggering: Ambushes start when a player comes near a
startPos(distance < 30.0). -
π² Chance per Trigger:
Config.BanditsChance(0β100) controls the trigger probability. -
β±οΈ Cooldown per Spot:
Config.SpotCooldownprevents a spot from triggering too often in succession (client-side per player). -
π§ NPC Spawns: Multiple bandits per spot with configurable ped models.
-
π Horses + Mounting: Bandits spawn with random horses and ride/dismount.
-
π« Combat Behavior: Bandits actively attack the player.
-
π§Ύ Outcome Handling
-
β οΈ Player dies β "robbed" message + server event is triggered.
-
π Player escapes (too far away) β "escaped" message + cleanup.
-
β All bandits dead β "cleared" message + cleanup.
-
-
π§ββοΈ Loot/Escape Sequence on Player Death: A bandit approaches the body, plays an inspect scenario animation, then the bandits ride away and are removed.
π¦ Dependencies
-
VORP Core or RSGCore (Supported β auto-detected at runtime)
-
Server: the script will try to use VORP APIs when available (
TriggerEvent("getCore", ...)) or RSGCore equivalents if present. It adapts at runtime. -
Client: uses the available notify events provided by VORP/RSG (see "Notifications").
-
Note: If neither framework is present, in-game notifications won't appear β adjust the
Notify(...)function inclient/client.luato use your notification system.
π Installation
-
Place the
Silly_Banditsfolder in your RedMresourcesfolder. -
Start it in your
server.cfg:-
ensure Silly_Bandits
-
-
Make sure **VORP or RSGΒ **is started beforehand.
General Settings
-
Config.SpotCooldown-
Cooldown per spot in milliseconds.
-
Example:
30 * 60 * 1000= 30 minutes
-
-
Config.BanditsChance- Percentage chance that a spot triggers (0β100).
-
Config.runAwayDis- Distance at which you are considered "escaped".
Spots / Bandits
Config.Bandits is a list of spots:
-
startPos = vector3(x, y, z)β Trigger position -
bandits = { ... }β List of NPCs-
pos = vector3(x, y, z)β Spawn position -
npc = "MODEL_NAME"β Ped model (not all models work)
-
Messages
Config.Messages defines text + display time (ms) for:
-
ambush(at start) -
robbed(when player dies) -
escaped(when player escapes) -
cleared(when all bandits are dead)
If you use a different notification system, adjust the Notify(...) function in client/client.lua.
π§© Server Event: "robbed"
When the player dies during an ambush, this is triggered:
-
TriggerServerEvent("silly_bandits:server:robbed")
The handler is in server/server.lua. Currently, removing money is only prepared as a comment.
π§° Notes / Troubleshooting
-
Ped Models: If a model doesn't exist/isn't streamable, the corresponding NPC won't spawn.
-
Cooldown is client-side: The cooldown is stored locally per player. If you want a global cooldown, it would need to be tracked server-side.
-
Balance: Number of bandits, weapons, and horse models are defined in the client script.

