Need help with Guis not working

Hello, I am currently working on a game by myself. In it I use teleporting, and so, I wanted to make a Gui that covers the whole screen and just said something like “teleporting”.
the problem is it does not become visible.

I have tried many things but it does not work for some reason. Here is the code:

game.ReplicatedStorage.GuiEvent.OnClientEvent:Connect(function(player)
print("Picked up GuiEvent")
game.StarterGui.ScreenGui.Frame.Visible = true
end)

For your information the problem is not the RemoteEvent. The print I use on the code always works, and it also always teleports. But the Gui never becomes visible. I usually don’t come here since I can fix most of the mistakes but I dont know what it is. I just can’t fix it, I am kind of desperate and I feel like it will be a dumb mistake for my part. Please help if you can.

What the player sees on their screen are descendants of their PlayerGui, which is cloned from StarterGui into their PlayerGui. You need to reference the gui object in their PlayerGui:

If the script is a child of the gui itself, just reference the gui by:

local gui = script.Parent

Or you can use this:

local player = game.Players.LocalPlayer
local pgui = player:WaitForChild("PlayerGui")
local sgui = pgui:WaitForChild("ScreenGui") -- here is where you put the name of the ScreenGui
local gui = sgui:WaitForChild("Gui") -- here is where you put the name of the gui. If it's not a parent of the ScreenGui itself, then you'd need to do more referencing
2 Likes

I did not know this… Thank you for the info! I will test it right away!