OnPlayerPullDown
A player on foot asks to pull a rider off their horse - return false to refuse, or the chance it works.
The game’s take-down move: the player on foot takes hold of a rider from the side of the horse, the two play the game’s own
pair, and the rider is thrown off and falls (or, when the pull fails, stays in the saddle). Only a player you allowed
(SetPlayerPullDown) gets the prompt. By the time this runs the server has checked the ask - both players stand in the
world (neither dead) in one virtual world, the puller is on foot and the rider is in the saddle of a horse, neither is in a
pull-down or a fall, a cart, flying, a dice match, a shop or a dialogue, the puller’s game can play the move, both are in view of
each other, pvp is on and the two are neither teammates nor party members (as for a blow), no wall is between them when the
server’s line-of-sight rule is on, and the horse is within the weapon’s reach and not faster than the weapon allows. The game’s own numbers are a sword, an axe, a mace or a sabre 2.5 m
and 6 m/s, a longsword 3 m and 7, a halberd 4 m and 8, bare hands 2 m and 4; the server allows 1.5 m more of reach and 1 m/s more
of pace than those, because the positions it goes by are a few frames old, so a sword pulls a horse up to 4 m away that goes up
to 7 m/s, and bare hands one up to 3.5 m away at up to 5 m/s. A dagger, a flail, a shield, a torch, a bow or a gun cannot pull
anyone down (the server knows the weapon from the game’s tables export; without the export every drawn weapon but a torch
counts as a sword). Each refusal a rule makes (pvp, teams, parties, the weapon, the reach, the pace) tells the puller why in
the chat, at most once every 15 seconds; a missing right, a busy or invalid pair of players and a wall in the way only reach
the server’s log.
This is the mode’s say on top: return false to refuse (nothing plays; the puller reads “You cannot pull Hans off the
horse.”), a number from 0 to 1 for the chance the pull works (0 plays the failed pair, 1 always works; a number
outside is held to the nearer end), anything else - nothing, nil, true, or an error in the callback - lets it stand at a
chance of 1. The server rolls the outcome itself, so every screen plays the same
one. A cooldown, a protection time or a price belong here; OnPlayerPulledDown tells how it ended.
A player the mode pulls with PullPlayerFromHorse does not come through here.
Syntax
Section titled “Syntax”function OnPlayerPullDown(pid, victim, id) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player pulling |
victim |
number | the rider |
id |
number | the horse |
Returns
Section titled “Returns”false refuses; a number from 0 to 1 is the chance it works; anything else lets it stand
Example
Section titled “Example”-- a 20 second rest between pulls, and three in four worklocal lastPull = {}function OnPlayerPullDown(pid, victim, id) if GetServerTime() - (lastPull[pid] or -60000) < 20000 then SendClientMessage(pid, COLOR_RED, "You are out of breath.") return false end lastPull[pid] = GetServerTime() return 0.75endSee also
Section titled “See also”OnPlayerPulledDown · SetPlayerPullDown · PullPlayerFromHorse · the Horses group of the index
