Alright. So I am creating a huge game universe, and I have a separate place reserved for the introduction. The introduction is basically a few ImageLabel GUI's which are scripted to activate in a sequence to resemble a sort of cutscene. There are no errors in the script.
The script is supposed to force each GUI to become visible and then invisible after an amount of time, and then teleport the player to the next place. However, what happens is that the GUI's don't become invisible OR visible at all! As a result, it just stays on the first frame. It does, however, teleport the player to the desired place. My script is posted below.
local player = script.Parent.Parent game.StarterGui.ScreenGui.Q1.Visible = true game.StarterGui.ScreenGui.Q2.Visible = false game.StarterGui.ScreenGui.Q3.Visible = false game.StarterGui.ScreenGui.Q4.Visible = false game.StarterGui.ScreenGui.Q5.Visible = false game.StarterGui.ScreenGui.Story.Visible = false wait(2) game.StarterGui.ScreenGui.Q1.Visible = false game.StarterGui.ScreenGui.Q2.Visible = true game.StarterGui.ScreenGui.Q3.Visible = false game.StarterGui.ScreenGui.Q4.Visible = false game.StarterGui.ScreenGui.Q5.Visible = false game.StarterGui.ScreenGui.Story.Visible = false wait(2) game.StarterGui.ScreenGui.Q1.Visible = false game.StarterGui.ScreenGui.Q2.Visible = false game.StarterGui.ScreenGui.Q3.Visible = true game.StarterGui.ScreenGui.Q4.Visible = false game.StarterGui.ScreenGui.Q5.Visible = false game.StarterGui.ScreenGui.Story.Visible = false wait(2) game.StarterGui.ScreenGui.Q1.Visible = false game.StarterGui.ScreenGui.Q2.Visible = false game.StarterGui.ScreenGui.Q3.Visible = false game.StarterGui.ScreenGui.Q4.Visible = true game.StarterGui.ScreenGui.Q5.Visible = false game.StarterGui.ScreenGui.Story.Visible = false wait(2) game.StarterGui.ScreenGui.Q1.Visible = false game.StarterGui.ScreenGui.Q2.Visible = false game.StarterGui.ScreenGui.Q3.Visible = false game.StarterGui.ScreenGui.Q4.Visible = false game.StarterGui.ScreenGui.Q5.Visible = true game.StarterGui.ScreenGui.Story.Visible = false wait(5) game.StarterGui.ScreenGui.Q1.Visible = false game.StarterGui.ScreenGui.Q2.Visible = false game.StarterGui.ScreenGui.Q3.Visible = false game.StarterGui.ScreenGui.Q4.Visible = false game.StarterGui.ScreenGui.Q5.Visible = false game.StarterGui.ScreenGui.Story.Visible = true wait(15) if player then game:GetService("TeleportService"):TeleportToSpawnByName(73690355, "SpawnLocation", player) end
Any ideas?
You're doing this on StarterGui, which is a parent of Game, not your player, thus is why you cannot see it.
-- Inside a LocalScript, parent in the StarterGui local player = game.Players.LocalPlayer local gui = script.Parent["ScreenGui"] for i = 1, 5 do wait(2) gui.Q1.Visible = false gui.Q2.Visible = false gui.Q3.Visible = false gui.Q4.Visible = false gui.Q5.Visible = false gui:findFirstChild("Q"..i).Visible = true end wait(5) gui.Q5.Visible = false gui.Story.Visible = true wait(15) if player then game:GetService("TeleportService"):TeleportToSpawnByName(73690355, "SpawnLocation", player) end
The problem is that you are acting on the game.StarterGui rather than the player.PlayerGui.
So everywhere in your script where you write game.StarterGui.ScreenGui.XYZ.Visible = true/false
change it to player.PlayerGui.ScreenGui.XYZ.Visible = true/false
[Edit]
IntellectualBeing's idea will make your code simpler, but it won't fix the problem you are having. When you modify the object that exists in game.StarterGui it will affect the object that is given to players when they spawn. You must modify the object that exists in the player's PlayerGui or the modifications will not affect the player.