I have a gui which opens whenever a couple lines of code are finished however open enabling the gui it works and all of its features work but upon dissabling it / hiding it, it wont reopen
The 1st section of code to opening it is :
local ClickDetector = script.Parent.ClickDetector
ClickDetector.MouseClick:Connect(function(Player)
local PGui = Player.PlayerGui
PGui.RiverPerson.BoatQuote1.Enabled = true
PGui.RiverPerson.BoatQuote1.Last.Frame.Text.Script.Disabled = false
wait(2.5)
PGui.RiverPerson.BoatQuote1.Enabled = false
PGui.RiverPerson.BoatQuote1.Last.Frame.Text.Script.Disabled = true
if PGui.TravellerGUI.Enabled == false then
PGui.TravellerGUI.Enabled = true
end
end)
From what you stated, I am going to assume you are using a server-script to close the Ui and a local-script to open it. This you cannot do, because some changes on the server are different on client.
Using code blocks would’ve been a bit better but anyways
You should stick a “type” of script, either local or server, I suggest for UI visibility etc it should be local, it should be a serverscript when you are adding functionality to the ui.
Try using both as localscripts (or serverscripts, whichever) and it should work.
If the server-sided script thinks that the UI is already enabled (even if locally is no) it will not try to enable it again. Instead try firing a RemoteEvent to the client and enable the UI from there.