饥荒mod吧 关注:57,810贴子:235,538
  • 3回复贴,共1

分享: 有会代码的大佬嘛?我想给自己做的一个手杖Mod添加一个时间耐

只看楼主收藏回复

IP属地:江西来自Android客户端1楼2018-04-08 13:49回复
    晨星相关代码如下:
    inst:AddComponent("fueled")
    inst.components.fueled:SetSectionCallback(
    function(section)
    if section == 0 then
    --when we burn out
    if inst.components.burnable then
    inst.components.burnable:Extinguish()
    end
    if inst.components.inventoryitem and inst.components.inventoryitem:IsHeld() then
    local owner = inst.components.inventoryitem.owner
    inst:Remove()
    if owner then
    owner:PushEvent("nightstickranout", {nightstick = inst})
    end
    end
    end
    end)
    inst.components.fueled:InitializeFuelLevel(TUNING.NIGHTSTICK_FUEL)
    inst.components.fueled:SetDepletedFn(function(inst) inst:Remove() end)


    IP属地:江西来自Android客户端2楼2018-04-08 13:54
    回复
      2025-05-11 07:49:59
      广告


      3楼2018-04-23 19:27
      回复


        4楼2018-04-24 16:53
        回复