`=' 附近预期为 'local' 的 roblox lua 错误

我收到一个错误,说在第3行,`=' 附近预期为 'local'。

我正在尝试这个:local = fireball = game.ServerStorage.Fireball。

我在我以为需要的地方键入等号,但它不起作用...

这是代码:

local cannon = script.Parent
local barrel = script Workspace.cannontrap.TrapBarrel
local = fireball = game.ServerStorage.Fireball

while true do
    local fireballCopy = fireball:Clone()
    fireballCopy.Parent = game.Workspace
    fireballCopy.Position = barrel.Position
    fireballCopy.Velocity = Vector3.new(-80,0,0)
    wait(8)
end

(第3行对于此错误是不正确的)。

点赞
用户107090
用户107090

错误信息很清晰。这行代码

local = fireball = game.ServerStorage.Fireball

应该改为

local fireball = game.ServerStorage.Fireball
2018-05-19 11:59:12
用户19670874
用户19670874

希望这能帮到你!

local 后面不应该有 "=",应该是:

local fireball = game.ServerStorage.Fireball
2023-01-31 17:08:15