Skip to content

StartFight

Puts two players in a fight so their games can lock on to each other.

From here either one’s game may pick the other’s body as the opponent - the direction indicators, the combat stance. The server starts a fight by itself when a swing reaches a body and on /fight <name>; this is the mode’s way (reason "mode"). On a fight that is already running it restarts the [combat] fight_timeout clock - a duel mode calls it every second so two circling duelists never lose the lock. false when pvp is off, one of the two is dead or not in the world, or they are in different virtual worlds. Teammates can be put in a fight, but their hits stay refused.

StartFight(a, b)
Parameter Type
a number one player
b number the other

boolean - true when the two fight now

-- the arena keeps the duel alive while it lasts
SetTimer(function()
if duel and duel.live then StartFight(duel.a, duel.b) end
end, 1000, true)

EndFight · AreFighting · GetPlayerOpponents · OnFightStart · the Combat group of the index