搜索
查看: 737|回复: 6

[求助] 求助这是怎么回事啊急急急

[复制链接]
发表于 2020-9-15 19:38:35 | 显示全部楼层 |阅读模式
2020/9/15 19:35:13 {0814} [string "D:\mirserver\Mir200\LuaScripts\System\BindE..."]:419: attempt to perform arithmetic on local 'nPoint' (a userdata value)
stack traceback:
        [string "D:\mirserver\Mir200\LuaScripts\System\BindE..."]:419: in function <[string "D:\mirserver\Mir200\LuaScripts\System\BindE..."]:381>

M2上一直这个,每秒一次

发表于 2020-9-15 20:50:15 | 显示全部楼层
BindEvent.lua  检查381行
 楼主| 发表于 2020-9-15 21:46:26 | 显示全部楼层
神话 发表于 2020-9-15 20:50
BindEvent.lua  检查381行

--计算攻击威力(返回输出威力)
function on_GetAttackPower(actor, nPoint)
  local incPoint = 0


补充内容 (2020-9-15 21:46):
这样的。381行,要怎么改吗,谢谢拉
发表于 2020-9-15 21:49:31 | 显示全部楼层
Lua脚本报错。。
 楼主| 发表于 2020-9-15 23:14:52 | 显示全部楼层
--计算攻击威力(返回输出威力)
function on_GetAttackPower(actor, nPoint)
  local incPoint = 0

  local RaceId = actor:getRace()--种族ID
  if (RaceId == 66) or (RaceId == 0) then--(英雄或人物)按角色的幸运值,进行威力加倍输出
    local luck = actor:getLuck()--取人物的幸运值
    if luck > 7 then
          if luck > 40 then
            incPoint= math.round(nPoint * 0.3)       
          elseif luck == 29 then
                incPoint= math.round(nPoint * 0.2)       
          elseif luck == 24 then
                incPoint= math.round(nPoint * 0.15)       
          elseif luck == 19 then
                incPoint= math.round(nPoint * 0.1)                       
          elseif luck == 18 then
                incPoint= math.round(nPoint * 0.09)                       
          elseif luck == 17 then
                incPoint= math.round(nPoint * 0.08)                       
      elseif luck == 16 then
                incPoint= math.round(nPoint * 0.07)                                       
      elseif luck == 15 then
                incPoint= math.round(nPoint * 0.06)                               
      elseif luck == 14 then
                incPoint= math.round(nPoint * 0.05)                       
      elseif luck == 13 then
                incPoint= math.round(nPoint * 0.04)       
          elseif luck == 12 then
                incPoint= math.round(nPoint * 0.3)
          elseif luck == 11 then
                incPoint= math.round(nPoint * 0.2)
          elseif luck == 10 then
            incPoint= math.round(nPoint * 0.1)
          end  
      --print("["..actor:getCharName().."]幸运值["..tostring(luck).."]造成威力加层["..tostring(incPoint).."]--[计算攻击威力(返回输出威力)]")       
    end  
  end

  return nPoint + incPoint
end

补充内容 (2020-9-15 23:15):
有没有大佬帮我看看,LUA这段脚本有什么问题吗,我是看不懂啊,各位好心的大哥们
 楼主| 发表于 2020-9-16 09:06:41 | 显示全部楼层
 楼主| 发表于 2020-9-16 09:46:59 | 显示全部楼层
弄好了,完结
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|HGEM2论坛

GMT+8, 2024-9-20 16:34 , Processed in 0.484270 second(s), 13 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表