Hello, I’ve been trying to find a way to make this image visible for the past two hours and cannot for the life of me figure it out. There are no errors in the output, what am I doing wrong?
The following code is in a regular Script:
local eggPart = script.Parent
local toggle = false
local amount = 1
local eggCover = game.StarterGui.CollectionGUI.EggMainFrame.ScrollingFrame.Egg1Cover
eggPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil and not toggle then
toggle = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local leaderboard = player:FindFirstChild("EggLeaderboard")
local eggs = leaderboard.Eggs
if eggs.Value < 20 then
eggs.Value = eggs.Value + amount
wait(1)
eggCover.Visible = true --This is the part not working, it runs the rest of the code.
wait()
eggPart.Transparency = 1
wait(5)
eggPart.Transparency = 0
end
end
end)
Screenshots
Location of Egg1Cover Image
Location of eggPart in the Workspace
Extra Information:
– The image’s visible property is set to False
by default
– The image’s Zindex is 2 (not sure if you really needed to know that)