')'预期(在'end'附近将'('封闭在第453行)

时间:2019-02-03 07:03:47

标签: lua

我无法找到)。请帮我解决一下这个。谢谢:)

ShootButton.MouseButton1Click:Connect(function()
local Person = NameShoot.Text
local A_1 = "right"
local A_2 = Vector3.new(-304.910004, 792.936279, -1810.74658)
local A_3 = Vector3.new(-321.448303, 792.981812, -1801.7301)
local A_4 = 0.0094182577133179
local A_5 = 2000
local A_6 =     
game:GetService("Workspace").TopPiece.Suit.RightHand.Thruster.Exhaust
local A_7 = game:GetService("Workspace")[Person].Suit.RightUpperArm.Union
local Event = 
game:GetService("Players").TopPiece.Backpack.suitControl.Assets.Events.fireR
epulsor
Event:InvokeServer(A_1, A_2, A_3, A_4, A_5, A_6, A_7)
end
end)

2 个答案:

答案 0 :(得分:4)

现在我不知道lua,但是我的猜测是最后改变这一点

end
end)

收件人

end)

看起来您要在函数的第一个结尾处结束,但是在函数完成后要在第二个结尾处关闭括号。

答案 1 :(得分:2)

如果您一致地缩进代码,则应该减少这类问题的发生...

ShootButton.MouseButton1Click:Connect(
  function()
    local Person = NameShoot.Text
    local A_1 = "right"
    local A_2 = Vector3.new(-304.910004, 792.936279, -1810.74658)
    local A_3 = Vector3.new(-321.448303, 792.981812, -1801.7301)
    local A_4 = 0.0094182577133179
    local A_5 = 2000
    local A_6 = game:GetService("Workspace").TopPiece.Suit.RightHand.Thruster.Exhaust
    local A_7 = game:GetService("Workspace")[Person].Suit.RightUpperArm.Union
    local Event = game:GetService("Players").TopPiece.Backpack.suitControl.Assets.Events.fireRepulsor
    Event:InvokeServer(A_1, A_2, A_3, A_4, A_5, A_6, A_7)
  end
)

很明显,end有一个function,而Connect函数调用有一个右括号。

您也可以这样做...

ShootButton.MouseButton1Click:Connect(function()
  local Person = NameShoot.Text
  local A_1 = "right"
  local A_2 = Vector3.new(-304.910004, 792.936279, -1810.74658)
  local A_3 = Vector3.new(-321.448303, 792.981812, -1801.7301)
  local A_4 = 0.0094182577133179
  local A_5 = 2000
  local A_6 = game:GetService("Workspace").TopPiece.Suit.RightHand.Thruster.Exhaust
  local A_7 = game:GetService("Workspace")[Person].Suit.RightUpperArm.Union
  local Event = game:GetService("Players").TopPiece.Backpack.suitControl.Assets.Events.fireRepulsor
  Event:InvokeServer(A_1, A_2, A_3, A_4, A_5, A_6, A_7)
end)

..但是我个人发现第一种格式更清晰。