Lua “)”预期(第453行的“toclose”)靠近“end”

Lua “)”预期(第453行的“toclose”)靠近“end”,lua,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) loca

我找不到支持的位置。请帮我解决这个问题。谢谢:

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)

现在我不知道lua,但我猜最后会改变这个

end
end)


看起来你是在用第一个端点结束函数,但在函数完成后关闭第二个端点上的括号。

现在我不知道lua,但我猜是在末尾更改它

end
end)


看起来您是在以第一个端点结束函数,但在函数完成后关闭第二个端点上的括号。

如果您一致地缩进代码,那么您应该减少这些类型的问题

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
)
很明显,函数有一个端点,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)

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

如果您一致地缩进代码,那么这些类型的问题应该会少一些

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
)
很明显,函数有一个端点,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)

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

如果代码中添加更多缩进,就更容易找出括号和结尾的位置。如果代码中添加更多缩进,就更容易找出括号和结尾的位置。