SetMonsterTarget

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

setMonsterTarget

Sets or clears the authoritative player target of a server-owned monster.

Syntax

bool setMonsterTarget(string monsterId, int playerId)

Parameters

Name Type Required Description
monsterId string yes The opaque decimal monster identifier returned by spawnMonster or getMonsters.
playerId int yes A connected player identifier, or 0 to clear the target.

Returns

Returns true when the target change is accepted; otherwise returns false.

Examples

Order a monster to attack a player:

setMonsterAggressive(monsterId, true)
setMonsterTarget(monsterId, playerId)

Notes

  • Available only in server-side resource scripts.
  • A nonzero target must refer to a currently connected player.