首页 > 解决方案 > ServerScriptService.Script:42: 预期的 ')' (关闭 '(' 在第 67 列),得到 ','

问题描述

我是 Roblox Lua 脚本的新手,在练习动态函数技能时,我发现了一个无法修复的错误。错误是这篇文章的标题。我试着弄乱括号,比如添加新的和删除一些,但我无法修复它。这是代码,谢谢。

    local mypart = Instance.new("Part")
    mypart.Name = name
    mypart.Transparency = 0.5
    mypart.BrickColor = BrickColor.new("Burgundy")
    mypart.Position = Vector3.new(5,5,5)
    mypart.Anchored = anchored
    mypart.Material = ("Ice")
    mypart.Parent = game.Workspace
    mypart.Reflectance = reflectance
end
generatePart("ArgumentOne", false, 0.7)
generatePart("ArgumentTwo", false, 0.7)

function owo(name, material, anchored, color)
    local gamermove = Instance.new("Part")
    gamermove.Name = name
    gamermove.Position = Vector3.new(9,9,9)
    gamermove.Transparency = 0.5
    gamermove.Anchored = anchored
    gamermove.BrickColor = color
    gamermove.CanCollide = true
    gamermove.Material = material
    gamermove.Parent = game.Workspace
end

owo("LoLoLolsoawdoaldowalda", ("Ice"), false, BrickColor.new("Black"))
owo("asdaasdasda", ("Ice"), false, BrickColor.new("Beige"))
owo("dawsdajkdnaw", ("Ice"), false, BrickColor.new("Bright bluish green"))

function gamer(name, transparency, anchored, material, parent, CanCollide, Vectorisa)
    local gamer = Instance.new("Part")
    gamer.Name = name 
    gamer.Transparency = transparency
    gamer.Anchored = anchored
    gamer.Material = material
    gamer.Parent = parent
    gamer.CanCollide = CanCollide
    gamer.Position = Vectorisa
end

gamer(("Free6ix9ine"), 0.5, false, ("Ice"), game.Workspace, true, (10,10,10)

标签: luasyntax-errorroblox

解决方案


阅读错误信息

ServerScriptService.Script:42: 预期的 ')' (关闭 '(' 在第 67 列),得到 ','

转到代码的第 42 行

gamer(("Free6ix9ine"), 0.5, false, , (10,10,10)("Ice"), game.Workspace, true, (10,10,10)

在你的脑袋里从里到外移除任何看起来不错的东西

("Free6ix9ine"), 0.5, false, , (10,10,10)("Ice"), game.Workspace, true, (10,10,10)

所以剩下的是

gamer(

这看起来有点不完整,你不觉得吗?

使用文本编辑器自动完成成对出现的所有内容并突出显示其中任何一个单独出现的内容。


推荐阅读