<name> 预期接近'end'错误

  • 本文关键字:错误 接近 end name lua
  • 更新时间 :
  • 英文 :


当我运行我的lua代码时,我得到了错误的'name'预期接近'end'|第12行

这是代码:

local i = 1
local plr = game.Players.LocalPlayer

function start()
repeat
    wait()
    game.ReplicatedStorage.addpoints:FireServer()
until i == 2
end
function end()
i = 2
end
plr.Chatted:connect(function(message)
if message == "start" then
    start()
elseif message == "end" then
    end()
end
end)

任何修复程序?

function end()
  i = 2
end

在这里,end是一个关键字,您不能将其用作函数名称。 stop

相关内容

最新更新