GUI not becoming invisible

Hi. I’m trying to make it so when a boolvalue changes, it checks if its value is true or false. If its true its meant to make a gui invisible, but that isnt happening. I tried both .Changed and GetPropertyChangedSignal() but neither worked. This script is in a localscript inside of the textlabel.

local function onChanged()
	if game.ReplicatedStorage.Round.InRound.Value == true then
		script.Parent.Visible = false
	else
		script.Parent.Visible = true
		
		end
	end

game.ReplicatedStorage.Round.InRound:GetPropertyChangedSignal("Value"):Connect(function(onChanged)

end)	

there’s currently 2 functions, one is still unused on top
the one below is currently an argument and contains nothing in there (it cannot be called as they’re in another event and remain unused)

local function onChanged()
	if game.ReplicatedStorage.Round.InRound.Value == true then
		script.Parent.Visible = false
	else
		script.Parent.Visible = true

	end
end

game.ReplicatedStorage.Round.InRound:GetPropertyChangedSignal("Value"):Connect(function(onchanged) -- This is not how you connect the function to an event, it is another function and it still contains an argument which is empty.

end)

game.ReplicatedStorage.Round.InRound:GetPropertyChangedSignal("Value"):Connect(onChanged) --connecting event should look like this

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