【问题标题】:Unknown Global in Roblox StudioRoblox Studio 中的未知全球
【发布时间】:2022-06-17 19:46:03
【问题描述】:

基本上,我不确定如何在第 4 行和第 27 行定义项目。如果有人可以帮助我,那就太好了。它只是在输出中说,未知的全局“项目”

for i,v in pairs(Buttons:GetChildren()) do
local NewItem = BoughtItems:FindFirstChild(v.Item.Value)
if NewItem ~= nil then
    Items[NewItem.Name] = NewItem:Clone()
    NewItem:Destroy()
else
    v.Transparency = 1
    v.CanCollide = false
end
if v:FindFirstChild("Dependency") then
    coroutine.resume(coroutine.create(function()
        v.ButtonPart.Transparency = 1
        v.ButtonPart.CanCollide = false
        if BoughtItems:WaitForChild(v.Dependency.Value, 100000) then
            v.ButtonPart.Transparency = 0
            v.ButtonPart.CanCollide = true
        end
    end))
end
v.ButtonPart.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if Values.OwnerValue.Value == Player then
            if v.ButtonPart.CanCollide == true and v.ButtonPart.Transparency == 0 then
                if Player:WaitForChild("leaderstats").Cash.Value >= v.Price.Value then
                    Player.leaderstats.Cash.Value -= v.Price.Value
                    Items[v.Item.Value].Parent = BoughtItems
                    v:Destroy()
                end
            end
        end
    end
end)

结束

【问题讨论】:

    标签: lua roblox luau


    【解决方案1】:

    如果更有意义的话,这里是一个屏幕截图。橙色下划线是一个未知的全局image

    【讨论】:

      猜你喜欢
      • 2020-09-01
      • 2018-12-29
      • 1970-01-01
      • 2019-07-24
      • 2021-12-06
      • 1970-01-01
      • 2023-04-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多