【发布时间】:2021-09-22 19:51:55
【问题描述】:
当我点击 5 次载入游戏时,它会消失,但不显示图像标签。 请帮忙!
local hits = 0
local model = script.Parent.Parent
game.StarterGui.Inventory.ImageLabel.Visible = false
script.Parent.ClickDetector.MouseClick:Connect(function()
hits = hits + 1
if hits > 4 then
model.Union.Transparency = 1
model.Union.CanCollide = false
model.Part1.Transparency = 1
model.Part1.CanCollide = false
model.Part2.Transparency = 1
model.Part2.CanCollide = false
model.Part3.Transparency = 1
model.Part3.CanCollide = false
model.Part4.Transparency = 1
model.Part4.CanCollide = false
game.StarterGui.Inventory.ImageLabel.Visible = true
wait(1)
game.StarterGui.Inventory.ImageLabel.Visible = false
end
end)
【问题讨论】:
-
如果您从
game.StarterGui.Inventory.ImageLabel.Visible开始设置为true,在您点击5 次之前是否可见? -
不,因为我想做的是制作新版本的 booga booga。我试图让它在你开采它时显示,它会显示铁矿石的图像,然后在 1 秒后它会消失! @尼菲姆
-
我明白,我的问题/建议是检查图像是否有效。通过最初将其设置为true,您应该会看到图像,如果您不这样做,您现在可以获得更多关于错误的信息,而不是继续点击5次并且它不会消失,再次详细了解具体没有的信息工作。
-
我该如何解决? @尼菲姆
-
使用 GetService。也可以尝试 waitforchild 而不是直接引用变量。