All entities trigger events||doc135766

September 20, 2022

Format

 Game.TriggersAll(name)
  • The class to which the function belongs:Game

Description

Triggers that trigger all entities with the specified name in the current game.


Parameters

Variable name type Description
name string trigger name


Code Samples

on the server sideglobal script, register the player entity 'Next_Game' function

local cfg = Entity.GetCfg("myplugin/player1")
Trigger.RegisterHandler(cfg, "Next_Game", function(context)
    local entity = context.obj1
    print(entity.ame)
end)

Trigger the 'Next_Game' function of all entities in the current game

Game.TriggersAll(NEXT_GAME)