dd198821 发表于 2026-10-12 23:10:07

佩戴切割写法996引擎飞剑脚本


local FLY_SWORD = {
id = 90001,
speed = 8,
duration = 15000,
damage = 100,
}

function OnSkillCast(player, target)
local sword = CreateEffect(player.x, player.y, "fly_sword")
local timer
timer = SetTimer(function()
    if not sword or not sword.alive then return end
    local tx, ty = GetTargetPos(player, target)
    MoveTo(sword, tx, ty, FLY_SWORD.speed)
    if Distance(sword, tx, ty) < 10 then
      Damage(target, FLY_SWORD.damage, player)
      DestroyEffect(sword)
      KillTimer(timer)
    end
end, 100)
end


local FlySword = {}
FlySword.__index = FlySword
function FlySword.new(owner, target, cfg) ... end
function FlySword:update(dt) ... end
function FlySword:onHit() ... end
function FlySword:destroy() ... end
return FlySword

页: [1]
查看完整版本: 佩戴切割写法996引擎飞剑脚本