This is supposed to work, (obviously), but it won't. If you could, please tell me how to FIX IT, and not ''well this is wrong''. Everything is in the correct place, period. If someone could, please take the five seconds it would take to fix it, or tell me what I did wrong and THEN EXPLAIN HOW I CAN FIX IT. ''it's wrong'' doesn't say anything.
The brick goes invisible, and so is the GUI (well, it's supposed to, anyways)
game.PlayerGui.GUI1.TextLabel.Visible = false --This turns GUI1 off wait(4) --this makes it wait for the next thing game.PlayerGui.GUI2.TextLabel.Visible = true --GUI2 IS DIFFERENT, SO I KNOW IF IT WORKS OR NOT
.
In the future, please place your code in a code block. You can do so by placing your code in between the lines created after clicking the little blue Lua symbol. Since your code is short, however, I can do it;
game.PlayerGui.GUI1.TextLabel.Visible = false --This turns GUI1 off wait(4) --this makes it wait for the next thing game.PlayerGui.GUI2.TextLabel.Visible = true --GUI2 IS DIFFERENT, SO I KNOW IF IT WORKS OR NOT
Your problem is that the PlayerGui
service you attempt to use does not exist.
There is a StarterGui
game service that is a "holder" for all GUIs. The GUIs in StarterGui will eventually be cloned into PlayerGui (which is a child of all Players) each time their Character respawns.
StarterGui is not what a Player is currently seeing; they are seeing whatever is in their PlayerGui. Changes made to the PlayerGui are not saved, however, for all GUIs will be "re-cloned" from StarterGui next time the Character respawns.
The hierarchy looks like this;
Game Players Player PlayerGui Gui StarterGui Gui
Although I don't know exactly what you want to happen, since you did not specify in your question, your best bet is probably to use a LocalScript inside a ScreenGui, with both GUIs places inside of a single ScreenGui. You may then access them easily.
Hierarchy:
StarterGui ScreenGui LocalScript GUI1 GUI2
You can then get the GUIs from simply, script.Parent.GUI1
.
script.Parent.GUI1.Visible = false wait(4) script.Parent.GUI2.Visible = true
Just remember that this code will run as soon as it is cloned into PlayerGui, so you may not be able to see the GUIs change perfectly due to a laggy camera.
Locked by User#2
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?