Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make this gui dialogue script work? Visible-to-invisible transition not working

Asked by
Skyyrn 1
3 years ago

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?

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago
local Door = game.Workspace.Door.DoorPart.ClickDetector
local P1 = Game.StarterGuiScreenGui.Frame.Pharaoh1
local P2 = Game.StarterGui.ScreenGui.Frame.Pharaoh2
local P3 = Game.StarterGui.ScreenGui.Frame.Pharaoh3
local P4 = Game.StarterGui.ScreenGui.Frame.Pharaoh4 <--- erase all if the 2-5 not everything just the Frame If You Do Have A Frame Otherwise don't :D

Door.MouseClick:Connect(function()
    P1.Visible = false
    wait(4.8)
    P1.Visible = true
    wait(8)
    P1.Visible = false
    wait(0.1)
    P2.Visible = true
    wait(5.9)
P2.Visible - false
wait(0.3)
    P3.Visible = true
    wait(6)
    P3.Visible = false
    wait(0.4)
    P4.Visible = true
   wait(6.5)
P4.Visible = false --then so on :D

end

-You Caused An Error Because The Pharaoh's The Roblox Game Does Not Get Where/What A Pharaoh is :D ps i am bad at scripting also D: If it Does Not Work here https://www.youtube.com/watch?v=yJglWQM0h5A <--- AlvinBlox

0
Oh I see, thanks Skyyrn 1 — 3y
0
Yw :) TheStevenYt7758 28 — 3y
Ad

Answer this question