Problem with Visible in ImageLabel

local rp = game:GetService("ReplicatedStorage")
local loadB = rp.HeavyPunch.Load
local ifLoad = false
local gui = game:GetService("StarterGui")

local function loading()
	local melee_Basic = script.Parent.Parent
	local melee1_Load = melee_Basic.Melee_Power_1.Melee_Power_1_Load

	gui.CombatMelee.Melee_Basic.Melee_Power_1.Melee_Power_1_Load.Visible = true
	print(melee1_Load.Visible)
	
	print("1")
	
	melee1_Load:TweenSize(UDim2.new(0,0,1,0), "Out", "Linear", 20, true)
	
	melee1_Load.Visible = false
end

while wait(1) do
	if loadB.Value == true then
		loading()
		
		wait(4)
		
		if loadB.Value == false then
			return
		end
	end
end

So here I have a script, the problem is that the line itself moves,but the visible does not turn on and off. If I print it, it says that visible = false. Here: what is the problem?
Снимок экрана 2023-05-14 в 19.37.43

The issue is local gui = game:GetService("StarterGui")
To fix it, you should replace the path of startergui with playergui.
If this is a local script, you should do
local gui=game.Players.LocalPlayer.PlayerGui

1 Like

Try shortening it to melee1_Load.Visible = true

I did it in the prints is now written true, but for some reason visible still does not change

If it prints true, then it should be visible. Check in explorer, also make sure nothing else (such as another script) is turning it off.

Shortening it like I said would prob work

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.