')' 预期(toclose '(' 在列453)邻近 '结束'

问题描述 投票: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.fireR
epulsor
Event:InvokeServer(A_1, A_2, A_3, A_4, A_5, A_6, A_7)
end
end)
lua
2个回答
4
投票

现在我不知道卢阿,但我的猜测是在最后改变这种

end
end)

end)

它看起来像你结束与第一端的功能,但收盘第二端的括号当函数已经完成。


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)

..但我个人认为第一格式更清晰。

© www.soinside.com 2019 - 2024. All rights reserved.