【问题标题】:My lua code runner is having a script error that im not sure how to fix我的 lua 代码运行程序出现脚本错误,我不确定如何修复
【发布时间】:2021-10-29 00:47:08
【问题描述】:

每当我尝试运行此代码时,它会在名为“Creat Your Frisk”的应用程序中显示“脚本遇到错误”ecounter: (line 48, char 3) 'end' expected near '' 有人可以帮助我/解释如何解决这个问题?

function HandleItem(ItemID)
if ItemID == "Cinnamon Bon" then 
    Player.Heal (10)
    BattleDialogu ({"you regain 10 HP!"})
end

https://i.stack.imgur.com/APlSe.png

【问题讨论】:

    标签: lua


    【解决方案1】:

    函数和if 语句块都由end 语句终止。

    function HandleItem(ItemID)
        if ItemID == "Cinnamon Bon" then 
            Player.Heal (10)
            BattleDialogu ({"you regain 10 HP!"})
        end
    end
    

    【讨论】:

      猜你喜欢
      • 2023-02-07
      • 2019-12-30
      • 2017-06-02
      • 1970-01-01
      • 2019-11-23
      • 2023-02-20
      • 2018-03-20
      • 1970-01-01
      • 2022-11-18
      相关资源
      最近更新 更多