这个 LUA 代码有一个似乎无法修复的结束错误

 local move = game.StarterGui.BottmRight.Hotbar
 local moves = false

 script.Parent.MouseButton1Click:connect(function()
 if moves == false then
 move:TweenPosition{UDim2.new{0.724,0,0.919,0},"In", "Bounce", 2}
 moves = true
 wait(2)
 move.Visible = true

 else
 move:TweenPosition{UDim2.new{0.912,0,0.919,0},"Out", "Quint", 2}
 moves = false
 move.Visible = false

错误是:

Error:(28,1) 期望'end'(关闭第11行的'else' ),得到 <eof>

有什么想法吗?

点赞
用户9112450
用户9112450

你需要一个“end”来关闭条件语句中的else块。尝试在最后一行放置“end)”…同时你还需要关闭:connect方法。

if user_input == "connect":
    print("Connecting...")
    client.connect()
else:
    print("Invalid command.")
end)
2018-04-01 02:41:11
用户1442917
用户1442917

你需要两个end语句来关闭if...elsefunction(),并且还需要关闭connect方法的)。因此,你需要添加end end)来修复错误。

2018-04-01 05:26:04