Get projectile configuration||doc135607

September 20, 2022

Format

 Missile.GetCfg(cfgName) 
  • The class to which the function belongs:Missile

Description

Get configuration information for the projectile object.


Parameters

Variable name type Description
cfgName string Configuration name


Value Returned

type Description
config configuration information


Code Samples

Find the corresponding projectile in the editor, right-click to copy its ID, plus the prefix is its name, such as 'myplugin/testMissile'

on the server sideglobal script, register when this type of projectile hits a blockCallbackbroadcast tipsthe object's name

local testMissileCfg =  Missile.GetCfg("myplugin/testMissile")    --Get missile config
Trigger.RegisterHandler(testMissileCfg, "HIT_BLOCK", function(context)  
   local entity = context.obj1
   local pos = context.pos
   World.CurWorld.SystemNotice(1, entity.name, 40)                --Broadcast entity name
end)