What I wanted to do is make a gui dialogue system for an Ancient Egypt-based game (project), so I came up with this script (please don't judge I'm very bad at scripting):
local clickDetector = game.Workspace.Door.DoorPart.ClickDetector
local Pharaoh1 = script.Parent.ScreenGui.Pharaoh1
local Pharaoh2 = script.Parent.ScreenGui.Pharaoh2
local Pharaoh3 = script.Parent.ScreenGui.Pharaoh3
local Pharaoh4 = script.Parent.ScreenGui.Pharaoh4
Pharaoh1.Visible = false
Pharaoh2.Visible = false
Pharaoh3.Visible = false
Pharaoh4.Visible = false
clickDetector.MouseClick:Connect(function()
Pharaoh1.Visible = true
wait(5)
Pharaoh1.Visible = false
Pharaoh2.Visible = true
wait(6)
Pharaoh2.Visible = false
Pharaoh3.Visible = true
wait(6)
Pharaoh3.Visible = false
Pharaoh4.Visible = true
wait(6)
Pharaoh4.Visible = false
end)
All four of the frames (Pharaoh 1-4) have different pieces of dialogue.
When the player opens a door, the first frame (Pharaoh1) is supposed to pop up; after 5 seconds, it becomes invisible and the second frame (Pharaoh2) pops up, and so on.
But when I join and test the game, all four of the ScreenGui frames are visible and not invisible like it says in lines 7-10. What am I doing wrong? How can I fix it?

2 comments
Oh I see, thanks
Yw :)