[HELP] Trying to make a display toggle-able

Using this heading bar script, and trying to make it toggle-able.

I’ve nearly got it, I can hit F9 to hide it, but hitting F9 again won’t bring it back. Here’s the code I’ve added to it.

if compass.show then 
        Citizen.CreateThread(function()
	        while true do
		        Citizen.Wait(1)
		        if IsControlJustPressed(0, 56) and compass.show == true then
			        compass.show = false
		        elseif IsControlJustPressed(0, 56) and compass.show == false then
			        compass.show = true
		        end
	        end
        end)
end

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