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
local PGui = Player.PlayerGui
PGui.RiverPerson.BoatQuote1.Enabled = true
PGui.RiverPerson.BoatQuote1.Last.Frame.Text.Script.Disabled = false
PGui.RiverPerson.BoatQuote1.Enabled = false
PGui.RiverPerson.BoatQuote1.Last.Frame.Text.Script.Disabled = true
if PGui.TravellerGUI.Enabled == false then
PGui.TravellerGUI.Enabled = true
Then the closing script is as follows :
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = workspace.RiverPoints.HotRiverPoint.CFrame
script.Parent.Parent.Parent.Parent.Enabled = false
I don’t really know why it doesnt work help would be appreciated!
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.
A local script to close it and server script to open it
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.
Yeah no that wouldnt work since connections dont work likr taht
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.
More info: Remote Functions and Events
Or just simply use the same script ‘type’, I dont see why you need to make the UI visible through the server tbh.
This would not work, try using only a server-script or only a local-script to enable/disable your Ui.
If you are unsure how client and server-sides work I can explain it to you.