Browse scripts
Wildlife
CV Wild Horses
cv-wildhorse
Rare breeds. Set times. Secret places. Your players have to ride out and find them.
On this page
- Overview
- How a wild horse lives
- Requirements
- Installation
- Files you can edit
- Configuration
- General
- Commands
- Notifications
- Rumours
- Adding your own breed
- Hours and days
- Weather names
- Chance
- Rumours
- Tips for good locations
- Discord logs
- Admin commands
- Developer API
- Exports
- Events
- State bag
- Examples
- Translation
- Version check
- Troubleshooting
Overview#
Wild horses appear at spots you choose, but only at the in-game hours, days and weather you set. An Arabian could show up only on Monday around noon, deep in the desert, or a herd of Nokotas could come out only in a snowstorm. When a rare one appears, a rumour spreads through town.
The server decides every spawn and every cleanup. Horses are never duplicated, they never pile up, and players can't dump the spawn locations from their game files.
- Client usage
- 0.00 ms
- Exports
- 10
- Events
- 6
- Herd size
- up to 8
Your own spawn table
Ships with an example breed (Breton Collection, 2 locations) and a commented template. Add as many breeds and spots as you like.
Time windows & days
Each breed has its own hours (they can run past midnight) and its own in-game days.
Weather conditions
"Only in snow", "only in a thunderstorm" — any weathersync weather.
Real rarity
Give a breed a spawn chance, e.g. 15%, so finding it feels special.
Herds
One spot can spawn a whole herd of 2 to 8 horses.
Rumours
Every player hears a hint when a rare breed appears — never the exact spot. Optional public Discord channel.
Spawns near players only
Horses appear only when someone is close. Each spot has a cooldown afterwards.
Locations stay secret
Only the server knows the table. A client only gets the one spawn it is asked to do.
Anti-cheat checks
Every spawn report is validated: the model and position must match.
Cleans up by itself
Dead bodies, out-of-hours horses and abandoned spawns are removed, even if the spawning player leaves.
Taming support
A horse a player breaks in becomes theirs and is never cleaned up. Built-in detection works on VORP and RSG Core.
Config checker
Spawn table mistakes are explained in the console on start. Only the broken breed is skipped.
Location helper
/whcoords prints your position as a line you paste straight into the config.
Fully translatable
Every message, rumour and Discord log lives in one locale.lua.
Any notify script
Framework notify by default. Plug in your own by changing one line.
Discord logs
Spawns, tames, removals, rejected reports and admin commands.
How a wild horse lives#
The server checks each breed
Every
Config.RNGTimerms: right hour? right day? right weather? A player nearby? Spot free and off cooldown?It rolls the breed's chance
No luck — the spot waits
Config.ChanceRetryDelayand tries again later.The closest player's game spawns it
One horse, or the whole herd around the spot.
The server verifies it
Right model? Right place? A mismatch is rejected and logged.
A rumour goes out
"A wild horse was spotted near…" (breeds with
rumouronly).
Tamed
The player keeps it. It's never cleaned up.
Killed
The body stays for
Config.DeadBodyTime, then it is removed.Its hours end
It is removed once no player is within
Config.CleanupRadius.Gone
The entity vanished, so it stops being tracked.
Requirements#
| Resource | Needed? | What for |
|---|---|---|
vorp_core or rsg-core | Required | Admin groups, notifications, character names in logs. Pick it with Config.Framework |
weathersync | Required | The in-game hour, day and weather. The resource won't start without it |
vorp_wildhorse | Optional | Also understood for taming on VORP. Not needed — the script has its own tame detection |
Installation#
Drop the folder in resources
Put
cv-wildhorsein yourresourcesfolder. Don't rename the folder.Pick your framework
Open
config.luaand setConfig.Frameworkto"vorp","rsg"or"auto"(whichever is installed).config.lua Config.Framework = "vorp" -- "vorp" · "rsg" · "auto"Add it to server.cfg, after its requirements
server.cfg ensure weathersync ensure vorp_core # or: ensure rsg-core # ensure vorp_wildhorse # optional ensure cv-wildhorseRestart the server
The console shows
Framework: VORP (vorp_core),Loaded X breed(s) with Y location(s)and the version box.
Files you can edit#
Only these four files are readable. Everything else is encrypted with Cfx Asset Escrow.
| File | What's inside |
|---|---|
config.lua | Framework, timers, distances, admin groups, command names, notifications, rumours, debug |
locale.lua | Every text: player messages, rumours, chat help, Discord logs |
server/sv_config.lua | The spawn table: breeds, models, hours, days, weather, herds, locations |
server/sv_webhook.lua | Discord log settings and the rumour channel |
Configuration#
General#
| Option | Default | What it does |
|---|---|---|
Config.Framework | "vorp" | "vorp", "rsg" or "auto". The console warns if the chosen framework isn't started |
Config.VersionCheck | true | Check for updates on start |
Config.Debug | false | Print spawn and cleanup info in the server console |
Config.DevMode | false | Ignore hours, days and weather. Testing only |
Config.RNGTimer | 10000 | How often the server checks for spawns (ms) |
Config.Radius | 200.0 | A player must be this close for a horse to spawn |
Config.CleanupRadius | 200.0 | A horse past its hours is removed once no player is this close |
Config.RespawnDelay | 600000 | Cooldown for a spot after it spawns (10 min) |
Config.DeadBodyTime | 300000 | How long a dead horse's body stays (5 min) |
Config.ChanceRetryDelay | 300000 | After a failed chance roll, how long the spot waits before rolling again (5 min) |
Config.RoutingBucket | 0 | Only players in this routing bucket count. 0 is the normal world, so character select and instances are ignored |
Config.HerdSpread | 6.0 | Herd members spawn up to this many metres from the spot |
Config.AdminGroups | { admin = true, god = true } | Who can use admin commands. VORP: user groups. RSG: rsg-core permission groups |
Config.TameDetection | true | Notice when a player breaks in a wild horse, on any framework. Only runs while riding a wild horse |
Config.DelsHorseAnyHorse | false | false: the delete command only removes this script's wild horses. true: any nearby horse, players' own too |
Commands#
Config.Commands = {
ForceSpawn = "forcespawn",
ResetCooldowns = "resetwildhorses",
DeleteHorse = "delshorse",
Coords = "whcoords",
List = "wildhorses",
}
Config.ChatSuggestions = true -- admins see help while typing the commandsRename any command if it clashes with another script. Set one to false to turn it off.
Notifications#
Every message players get goes through one function, Config.Notify.Send. By default it uses the framework's own notify (VORP right-side tip, or RSG Core notify). To use your own notify script, change that one line:
Config.Notify = {
Duration = 5000,
Send = function(src, text, duration, kind)
DefaultNotify(src, text, duration, kind) -- default: framework notify
-- your own notify script instead (use the event / export from its docs):
-- TriggerClientEvent("your_notify:show", src, text, duration, kind)
end,
}| Argument | What it is |
|---|---|
src | The player's server id |
text | The message (from locale.lua) |
duration | Config.Notify.Duration in ms |
kind | "info", "success", "error" or "rumour" — use it to pick a colour or icon |
Rumours#
Config.Rumours = {
Enabled = true,
Discord = true, -- also post to RumourURL in sv_webhook.lua
}Only breeds with rumour = true (or their own rumour text) send one, and only once per spawn or herd. The texts are in locale.lua.
Adding your own breed#
The top of server/sv_config.lua has a ready-made template with a note on every line.
Grab a location
Stand where the horse should appear, face the way it should look and type
/whcoords. Copy the line from your F8 console.Copy the template block
Paste it inside
Config.Spawns = { ... }, e.g. after the last breed's},.Fill it in and restart
Fill in the values, paste your location line, save, and restart the resource.
{
breed = "Nokota Collection",
startTime = 20, -- hour it starts (0-23)
endTime = 4, -- hour it ends (not included). Here: past midnight
validDays = {0, 6}, -- 0 Sun · 1 Mon · 2 Tue · 3 Wed · 4 Thu · 5 Fri · 6 Sat
weather = { "snow", "blizzard" }, -- optional: only in this weather
chance = 0.25, -- optional: 25% chance to appear (default 1.0 = always)
herd = { min = 2, max = 4 }, -- optional: a herd of 2 to 4 (max 8)
rumour = true, -- optional: tell players when it appears
models = {
'a_c_horse_nokota_blueroan',
'a_c_horse_nokota_whiteroan',
'a_c_horse_nokota_whiteroan', -- listed twice = twice as common
},
locations = {
{ coords = vector3(-1544.00, 663.38, 119.38), heading = 0.0, area = "Strawberry" },
},
},Hours and days#
| You write | It means |
|---|---|
startTime = 6, endTime = 10 | 6:00 to 9:59 |
startTime = 22, endTime = 3 | Past midnight: 22:00 to 2:59 |
endTime = 24 | Until midnight |
startTime = endTime | All day |
validDays = {0, 6} | Weekends only |
No validDays line | Every day |
Weather names#
- sunny
- clouds
- overcast
- overcastdark
- highpressure
- drizzle
- rain
- shower
- thunder
- thunderstorm
- hurricane
- fog
- misty
- hail
- sleet
- snow
- snowlight
- blizzard
- groundblizzard
- whiteout
- sandstorm
No weather line means any weather. A horse that has already spawned stays when the weather changes.
Chance#
| You write | It means |
|---|---|
No chance line | Always appears when a player comes near (inside its hours, days and weather) |
chance = 0.5 | 50% — a coin flip |
chance = 0.1 | 10% — a real treasure |
When the roll fails, that spot waits Config.ChanceRetryDelay (5 min by default) before it rolls again. A low chance means players have to come back, not just stand there.
Rumours#
| You write | Players see |
|---|---|
rumour = true + location area = "Strawberry" | Rumour has it a wild horse from the Nokota Collection was spotted near Strawberry. |
rumour = true, no area | Rumour has it a wild horse from the Nokota Collection was spotted somewhere out in the wild. |
rumour = "Hunters swear they saw a ghost-white horse..." | Your own text |
No rumour line | Nothing — the horse appears quietly |
Tips for good locations#
- Use open, flat ground. A spot in water, inside a building or under the map can fail to spawn.
- Each location holds one horse, or one herd, at a time. Add more locations if you want more.
- Herd members are placed on the ground around the spot, so give herds open space.
- Use only valid RDR2 horse models (
a_c_horse_...). A wrong name never spawns. - To test without waiting for the right hour, set
Config.DevMode = true— and set it back afterwards.
Discord logs#
Set these in server/sv_webhook.lua:
| Option | What it does |
|---|---|
Enabled | Turn the staff logs on or off |
URL | Staff log webhook. Discord channel → Edit Channel → Integrations → Webhooks → Copy Webhook URL |
Name / Avatar | Name and image the messages are posted with |
ShowCoords | Add coordinates to each staff log (on by default) |
Logs.* | Turn each type on or off: Spawn · Tame · Remove · Rejected · Admin |
RumourURL | Optional second webhook for rumours. No coords are ever posted there, so a public channel is fine |
Messages are queued one per second, so Discord's rate limit is never hit.
Admin commands#
Players in Config.AdminGroups can use these; the server console always can. With Config.ChatSuggestions, admins see help while typing. Rename them in Config.Commands.
| Command | Console | What it does |
|---|---|---|
/forcespawn [number] | No | Spawns that breed (and its herd) 3 m in front of you (default 1). Ignores hours, days, weather, chance and cooldowns |
/resetwildhorses | Yes | Resets every location's cooldown |
/delshorse | No | Deletes the closest wild horse within 10 m. Players' own horses are safe (see Config.DelsHorseAnyHorse) |
/whcoords | No | Prints your position as a ready-to-paste location line in your F8 console |
/wildhorses | Yes | Lists every active wild horse and every spot on cooldown |
Breed numbers for /forcespawn
The number is the breed's position in Config.Spawns: the first block is 1, the second 2, and so on. As shipped, 1 is the Breton Collection.
Adding, removing or moving breeds changes the numbers. Type /forcespawn in chat to see the valid range.
Developer API#
Connect your own scripts to wild horses: XP, achievements, quests, events, admin panels, target menus… All exports run on the server only, so cheaters can't call them. Where an export takes a breed, pass its number (position in Config.Spawns) or its name, e.g. "Breton Collection".
local WH = exports['cv-wildhorse']Exports#
| Export | Returns | What it does |
|---|---|---|
WH:GetActiveHorses() | list | Every tracked wild horse: { id, breed, model, netId, coords, location, herd, verified, dead } |
WH:IsWildHorse(netId) | true, breed / false | Is this entity one of our wild horses? |
WH:GetBreeds() | list | { index, breed, startTime, endTime, validDays, weather, chance, herd, rumour, locations, enabled, valid }. locations is a count — coords stay secret |
WH:IsBreedActive(breed) | true / false | Could this breed spawn right now? Checks hour, day, weather and whether it's on |
WH:SpawnBreed(breed, coords, heading?, withRumour?) | ids / nil, reason | Spawns the breed (and herd) anywhere. Ignores hours, days, weather, chance and cooldowns. Needs a player within Config.Radius |
WH:SetBreedEnabled(breed, enabled) | true / false | Turns natural spawning on/off until the next restart. Horses already out stay |
WH:ReleaseHorse(netId) | true / false | For other taming / stable scripts. The horse stops being wild, so it's never cleaned up |
WH:RemoveHorse(netId, reason?) | true / false | Deletes a wild horse, with the normal Discord log and removed event |
WH:ResetCooldowns(breed?) | number reset | Resets one breed's spots, or every spot when no breed is given |
WH:SendRumour(text) | true / false | Sends your own rumour to every player (and the rumour webhook) |
Events#
| Event | Arguments | When |
|---|---|---|
cv_wildhorse:spawned | horse | A horse was confirmed in the world |
cv_wildhorse:tamed | src, horse | Player src broke it in |
cv_wildhorse:released | horse, resource | Another script called ReleaseHorse |
cv_wildhorse:died | horse | It died (the body stays for Config.DeadBodyTime) |
cv_wildhorse:removed | horse, reason | It was cleaned up or deleted |
cv_wildhorse:rumour | text, horse | A rumour went out (horse is nil for SendRumour) |
State bag#
While a horse is wild, its entity carries the breed name. Any client or server script can read it without an export:
local breed = Entity(horseEntity).state.cvWildHorse -- "Breton Collection", or nil when it isn't wildExamples#
-- server side of your taming / stable script
exports['cv-wildhorse']:ReleaseHorse(NetworkGetNetworkIdFromEntity(horse))AddEventHandler("cv_wildhorse:tamed", function(src, horse)
if horse.breed == "Breton Collection" then
-- your XP / achievement code here
end
end)local ids, err = exports['cv-wildhorse']:SpawnBreed("Breton Collection", vector3(481.72, -260.30, 143.96), 51.0, true)
if not ids then print("Round-up failed: " .. err) endexports['cv-wildhorse']:SetBreedEnabled("Breton Collection", false)Translation#
Every text players, admins and Discord see is in locale.lua under Config.Text. Translate freely, but keep each %s / %d in the same order.
Config.Text = {
NoPermission = "You don't have permission to use this command.",
-- first %s = breed, second %s = the location's area
Rumour = "Rumour has it a wild horse from the %s was spotted near %s.",
RumourNoArea = "Rumour has it a wild horse from the %s was spotted somewhere out in the wild.",
...
}Version check#
On start, the console tells you whether you're up to date. Download new versions from your Cfx.re Keymaster account.
| To turn it off… | Do this |
|---|---|
| For this script | Config.VersionCheck = false |
| For every CronicalVerse script | Add set cv_versioncheck false to server.cfg |
Troubleshooting#
| Problem | Fix |
|---|---|
| "weathersync is not running… wild horses paused" | Start weathersync before this resource |
| "Config.Framework is … but … is not started" | Set Config.Framework to the framework you run, or "auto", and start it before this resource |
Config error - Breed #… | The message says what to fix in sv_config.lua. That breed is skipped until it's fixed |
| No horses spawn | Check the in-game hour, day and weather against the breed. A low chance also means fewer horses. To test, turn on Config.DevMode and Config.Debug, then off again |
| A weather breed never spawns | Check the weather name against the list. The console warns once if weathersync's getWeather() fails |
| No spawns for players in an instance | On purpose: only players in Config.RoutingBucket (the normal world) count |
/delshorse says "No wild horse nearby" | It only removes this script's wild horses within 10 m. Set Config.DelsHorseAnyHorse = true for any horse |
| A command clashes with another script | Rename it in Config.Commands |
[cv_wildhorse] Error: … | Something unexpected went wrong. The script keeps running. Send us the line |
| One location never spawns | Is a player within Config.Radius? Is the spot on cooldown? Check with /wildhorses, reset with /resetwildhorses |
Spawn Report Rejected in Discord | The reported horse didn't match the model or place. A few can be lag; many from one player is suspicious |
| Tamed horses disappear | Keep Config.TameDetection = true (or run vorp_wildhorse on VORP) |
You lack the required entitlement | Your server key isn't on the account that bought the asset |