What is wrong with my script?
The gui isn’t showing and no errors on the output.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RE = ReplicatedStorage:WaitForChild("Rules")
local RulesFrame = game.StarterGui.RulesGui.Frame
function ChooseRandomPlayer()
return game.Players:GetChildren()[math.random(1, #game.Players:GetChildren())]
end
wait(3)
local player = ChooseRandomPlayer()
game.ReplicatedStorage.Dialogue:FireAllClients(game.Workspace.AnhRedd, "Hello! Welcome to our Staff Assistant trainings!") -- Example of an NPC talking
wait(5)
RulesFrame.Visible = true
RE:FireAllClients()
game.ReplicatedStorage.Dialogue:FireAllClients(game.Workspace.AnhRedd, "I'm your host Anna. And I wish everyone good luck!") -- Example of an NPC talking
wait(5)
game.ReplicatedStorage.Dialogue:FireAllClients(game.Workspace.nor4ertbot, "I'm your co-host Norbert! I wish everyone good luck!")
wait(5)
game.ReplicatedStorage.Dialogue:FireAllClients(game.Workspace.AnhRedd, "I will now state the rules. Please pay undivided attention to the rules. ")
wait(5)
game.ReplicatedStorage.Dialogue:FireAllClients(game.Workspace.nor4ertbot, "A GUI will appear on your screen, if you are on 1st person I recommend changing that position because it may glitch. ")
wait (8)
game.ReplicatedStorage.Dialogue:FireAllClients(game.Workspace.nor4ertbot, "Once you finished reading the rules say 'Done!'. ")
wait (8)
game.ReplicatedStorage.Visible:FireAllClients(false) -- Example of the GUI hiding
well post a picture of the directory of the frame and all its parents, also make sure you when you run the game click on all of its parents see if they’re visible/enabled, and check the guis position
Everything is fine with position. Its because you told the script to make the GUI false. But you never made it true again. So make sure to add a wait after the
game.ReplicatedStorage.Visible:FireAllClients(false) – Example of the GUI hiding
line
and add
game.ReplicatedStorage.Visible:FireAllClients(true) – Example of the GUI showing
maybe error in RulesFrame? Try: for i,v in pairs(game.Players:GetChildren()) do
v.PlayerGui.RulesGui.Frame.Visible = true
end
P.s: You changed StarterGui,but not player gui.