此错误是什么意思?我似乎无法让这段代码工作



我试图让这个lua代码运行,但似乎无法让它工作。每当我运行它时,我都会收到此错误,无论我编辑多少次,我似乎都无法避免。 有人能找到解决方案吗?我一直在网上搜索无济于事。 这是我得到的错误

输入:58:EOF附近的意外符号

这是代码:

-- Made By Vincent

local ScreenGui = Instance.new("ScreenGui")
local Main = Instance.new("Frame")
local RoundedCorners = Instance.new("UICorner")
local BlackHoleGun = Instance.new("TextButton")
local UICorner = Instance.new("UICorner")
local GoldenPistol = Instance.new("TextButton")
local UICorner_2 = Instance.new("UICorner")
local CrazyFuturisticMinigun = Instance.new("TextButton")
local UICorner_3 = Instance.new("UICorner")
local BiochemicalBlaster = Instance.new("TextButton")
local UICorner_4 = Instance.new("UICorner")
local SpaceRifle = Instance.new("TextButton")
local UICorner_5 = Instance.new("UICorner")
local LavaPistol = Instance.new("TextButton")
local UICorner_6 = Instance.new("UICorner")
local Scar = Instance.new("TextButton")
local UICorner_7 = Instance.new("UICorner")
local RayGun = Instance.new("TextButton")
local UICorner_8 = Instance.new("UICorner")
local SniperRifle = Instance.new("TextButton")
local UICorner_9 = Instance.new("UICorner")
--Properties:
ScreenGui.Parent = game.CoreGui
Main.Name = "Main"
Main.Parent = ScreenGui
Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Main.Position = UDim2.new(0.383399218, 0, 0.121621616, 0)
Main.Size = UDim2.new(0, 426, 0, 211)
Main.Active = true
Main.Draggable = true
RoundedCorners.Name = "RoundedCorners"
RoundedCorners.Parent = Main
BlackHoleGun.Name = "Black Hole Gun"
BlackHoleGun.Parent = ScreenGui
BlackHoleGun.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
BlackHoleGun.Position = UDim2.new(0.393280655, 0, 0.136486486, 0)
BlackHoleGun.Size = UDim2.new(0, 121, 0, 49)
BlackHoleGun.Font = Enum.Font.GothamBold
BlackHoleGun.Text = "Black Hole Gun"
BlackHoleGun.TextColor3 = Color3.fromRGB(255, 219, 0)
BlackHoleGun.TextScaled = true
BlackHoleGun.TextSize = 14.000
BlackHoleGun.TextStrokeColor3 = Color3.fromRGB(174, 38, 148)
BlackHoleGun.TextWrapped = true
BlackHoleGun.MouseButton1Down:connect(function()
local Remote = game.Workspace.__THINGS.__REMOTES['weaponequipped']
local Arguments = {
[1] = {
[1] = {
[1] = "Black Hole Gun"
},
[2] = {
[1] = false
}
}
}
Remote:FireServer(unpack(Arguments))

UICorner.Parent = BlackHoleGun

GoldenPistol.Name = "Golden Pistol"
GoldenPistol.Parent = ScreenGui
GoldenPistol.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
GoldenPistol.Position = UDim2.new(0.533596873, 0, 0.136486486, 0)
GoldenPistol.Size = UDim2.new(0, 121, 0, 49)
GoldenPistol.Font = Enum.Font.GothamBold
GoldenPistol.Text = "Golden Pistol"
GoldenPistol.TextColor3 = Color3.fromRGB(255, 219, 0)
GoldenPistol.TextScaled = true
GoldenPistol.TextSize = 14.000
GoldenPistol.TextStrokeColor3 = Color3.fromRGB(174, 38, 148)
GoldenPistol.TextWrapped = true
NAMEOFBUTTONHERE.MouseButton1Down:connect(function()
local Remote = game.Workspace.__THINGS.__REMOTES['weaponequipped']
local Arguments = {
[1] = {
[1] = {
[1] = "Golden Pistol"
},
[2] = {
[1] = false
}
}
}
Remote:FireServer(unpack(Arguments))

end)
UICorner_2.Parent = GoldenPistol
CrazyFuturisticMinigun.Name = "Crazy Futuristic Minigun"
CrazyFuturisticMinigun.Parent = ScreenGui
CrazyFuturisticMinigun.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
CrazyFuturisticMinigun.Position = UDim2.new(0.673913062, 0, 0.136486486, 0)
CrazyFuturisticMinigun.Size = UDim2.new(0, 121, 0, 49)
CrazyFuturisticMinigun.Font = Enum.Font.GothamBold
CrazyFuturisticMinigun.Text = "Crazy Futuristic Minigun"
CrazyFuturisticMinigun.TextColor3 = Color3.fromRGB(255, 219, 0)
CrazyFuturisticMinigun.TextScaled = true
CrazyFuturisticMinigun.TextSize = 14.000
CrazyFuturisticMinigun.TextStrokeColor3 = Color3.fromRGB(174, 38, 148)
CrazyFuturisticMinigun.TextWrapped = true
NAMEOFBUTTONHERE.MouseButton1Down:connect(function()
local Remote = game.Workspace.__THINGS.__REMOTES['weaponequipped']
local Arguments = {
[1] = {
[1] = {
[1] = "Crazy Futuristic Minigun"
},
[2] = {
[1] = false
}
}
}
Remote:FireServer(unpack(Arguments))

end)
UICorner_3.Parent = CrazyFuturisticMinigun
BiochemicalBlaster.Name = "Biochemical Blaster"
BiochemicalBlaster.Parent = ScreenGui
BiochemicalBlaster.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
BiochemicalBlaster.Position = UDim2.new(0.393280655, 0, 0.231081083, 0)
BiochemicalBlaster.Size = UDim2.new(0, 121, 0, 49)
BiochemicalBlaster.Font = Enum.Font.GothamBold
BiochemicalBlaster.Text = "Biochemical Blaster"
BiochemicalBlaster.TextColor3 = Color3.fromRGB(255, 219, 0)
BiochemicalBlaster.TextScaled = true
BiochemicalBlaster.TextSize = 14.000
BiochemicalBlaster.TextStrokeColor3 = Color3.fromRGB(174, 38, 148)
BiochemicalBlaster.TextWrapped = true
NAMEOFBUTTONHERE.MouseButton1Down:connect(function()
local Remote = game.Workspace.__THINGS.__REMOTES['weaponequipped']
local Arguments = {
[1] = {
[1] = {
[1] = "Biochemical Blaster"
},
[2] = {
[1] = false
}
}
}
Remote:FireServer(unpack(Arguments))
end)
UICorner_4.Parent = BiochemicalBlaster
SpaceRifle.Name = "Space Rifle"
SpaceRifle.Parent = ScreenGui
SpaceRifle.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
SpaceRifle.Position = UDim2.new(0.533596873, 0, 0.231081083, 0)
SpaceRifle.Size = UDim2.new(0, 121, 0, 49)
SpaceRifle.Font = Enum.Font.GothamBold
SpaceRifle.Text = "Space Rifle"
SpaceRifle.TextColor3 = Color3.fromRGB(255, 219, 0)
SpaceRifle.TextScaled = true
SpaceRifle.TextSize = 14.000
SpaceRifle.TextStrokeColor3 = Color3.fromRGB(174, 38, 148)
SpaceRifle.TextWrapped = true
NAMEOFBUTTONHERE.MouseButton1Down:connect(function()
local Remote = game.Workspace.__THINGS.__REMOTES['weaponequipped']
local Arguments = {
[1] = {
[1] = {
[1] = "Space Rifle"
},
[2] = {
[1] = false
}
}
}
Remote:FireServer(unpack(Arguments))

end)
UICorner_5.Parent = SpaceRifle
LavaPistol.Name = "Lava Pistol"
LavaPistol.Parent = ScreenGui
LavaPistol.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
LavaPistol.Position = UDim2.new(0.672924936, 0, 0.231081083, 0)
LavaPistol.Size = UDim2.new(0, 121, 0, 49)
LavaPistol.Font = Enum.Font.GothamBold
LavaPistol.Text = "Lava Pistol"
LavaPistol.TextColor3 = Color3.fromRGB(255, 219, 0)
LavaPistol.TextScaled = true
LavaPistol.TextSize = 14.000
LavaPistol.TextStrokeColor3 = Color3.fromRGB(174, 38, 148)
LavaPistol.TextWrapped = true
NAMEOFBUTTONHERE.MouseButton1Down:connect(function()
local Remote = game.Workspace.__THINGS.__REMOTES['weaponequipped']
local Arguments = {
[1] = {
[1] = {
[1] = "Lava Pistol"
},
[2] = {
[1] = false
}
}
}
Remote:FireServer(unpack(Arguments))

end)
UICorner_6.Parent = LavaPistol
Scar.Name = "Scar"
Scar.Parent = ScreenGui
Scar.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
Scar.Position = UDim2.new(0.392292529, 0, 0.322972983, 0)
Scar.Size = UDim2.new(0, 121, 0, 49)
Scar.Font = Enum.Font.GothamBold
Scar.Text = "Scar"
Scar.TextColor3 = Color3.fromRGB(255, 219, 0)
Scar.TextScaled = true
Scar.TextSize = 14.000
Scar.TextStrokeColor3 = Color3.fromRGB(174, 38, 148)
Scar.TextWrapped = true
NAMEOFBUTTONHERE.MouseButton1Down:connect(function()
local Remote = game.Workspace.__THINGS.__REMOTES['weaponequipped']
local Arguments = {
[1] = {
[1] = {
[1] = "SCAR"
},
[2] = {
[1] = false
}
}
}
Remote:FireServer(unpack(Arguments))

end)
UICorner_7.Parent = Scar
RayGun.Name = "Ray Gun"
RayGun.Parent = ScreenGui
RayGun.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
RayGun.Position = UDim2.new(0.533596873, 0, 0.322972983, 0)
RayGun.Size = UDim2.new(0, 121, 0, 49)
RayGun.Font = Enum.Font.GothamBold
RayGun.Text = "Ray Gun"
RayGun.TextColor3 = Color3.fromRGB(255, 219, 0)
RayGun.TextScaled = true
RayGun.TextSize = 14.000
RayGun.TextStrokeColor3 = Color3.fromRGB(174, 38, 148)
RayGun.TextWrapped = true
NAMEOFBUTTONHERE.MouseButton1Down:connect(function()
local Remote = game.Workspace.__THINGS.__REMOTES['weaponequipped']
local Arguments = {
[1] = {
[1] = {
[1] = "Ray Gun"
},
[2] = {
[1] = false
}
}
}
Remote:FireServer(unpack(Arguments))

end)
UICorner_8.Parent = RayGun
SniperRifle.Name = "Sniper Rifle"
SniperRifle.Parent = ScreenGui
SniperRifle.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
SniperRifle.Position = UDim2.new(0.672924936, 0, 0.322972983, 0)
SniperRifle.Size = UDim2.new(0, 121, 0, 49)
SniperRifle.Font = Enum.Font.GothamBold
SniperRifle.Text = "Sniper Rifle"
SniperRifle.TextColor3 = Color3.fromRGB(255, 219, 0)
SniperRifle.TextScaled = true
SniperRifle.TextSize = 14.000
SniperRifle.TextStrokeColor3 = Color3.fromRGB(174, 38, 148)
SniperRifle.TextWrapped = true
NAMEOFBUTTONHERE.MouseButton1Down:connect(function()
local Remote = game.Workspace.__THINGS.__REMOTES['weaponequipped']
local Arguments = {
[1] = {
[1] = {
[1] = "Sniper Rifle"
},
[2] = {
[1] = false
}
}
}
Remote:FireServer(unpack(Arguments))

end)
UICorner_9.Parent = SniperRifle

随着时间的推移,您将学习如何快速发现此类错误。如果您不知道从哪里开始,有几种方法可以解决这个问题。

  1. 阅读代码并在脑海中检查缺少的内容(专业级)

  2. 从代码中删除语法正确的所有内容

    在您的示例中,您最终会得到BlackHoleGun.MouseButton1Down:connect(function()这是一个不完整的函数调用,具有不完整的函数定义。因此,您知道必须在该函数主体的末尾放置一个end,并且您需要)才能关闭该函数调用。

  3. 计算成对出现的东西(大多数编辑器都可以这样做)。

    在你的例子中,你有 36{, 36}, 54[, 54], 105(104)哎呀! -> 1)短!

    你有 8 个end0do+ 0then+ 9function-> 1end

    !现在检查这些东西丢失的地方并添加它们。

避免此类错误的一个很好的方法是使用文本编辑器/IDE自动完成对。

您在第 53 行声明BlackHoleGun.MouseButton1Down:connect缺少函数的末尾。没有右括号。 我想你失踪了

end)

在第 67 行之后。

相关内容

最新更新