release skills||doc135602

September 20, 2022

Format

 Skill.Cast(fullName, packet, entity)
  • The class to which the function belongs:Skill

Description

Unleash your skills.


Parameters

parameter name type Description
fullName string myplugin/ is spliced with the editor skill name
packet table Some optional parameters when the skill is released, can be empty
entity Entity The entity object that releases the skill

To cast the cast_grenade skill, fullName is ("myplugin/" .. "cast_grenade") or ("myplugin/cast_grenade")


Precautions

Adding the needPre field to the packet will play the skill action


Code Samples

Server-side registered player login event generationCallback, the player will release the skill after logging in.

ps: If you can't see the effect, it may be because the skill duration has expired, because the trigger time of the login event is before the game world can be seen.

Trigger.RegisterHandler(Entity.GetCfg("myplugin/player1"), "ENTITY_ENTER", function(context)
    local player = context.obj1
    Skill.Cast("myplugin/" .. "cast_grenade", {needPre = true}, player)
end)