Greetings. How can I make a frame appear when player joins and disappear after 5 seconds?

How can I make a frame appear when player joins and disappear after like 5 seconds for example?

Try doing something like this, normal Script in ServerScriptService:

-- Get the players service, alternatively you could just do game.Players
local players = game:GetService('Players')

players.PlayerAdded:Connect(function(plr)
    -- This will be the frame you want to show
    local frame = plr.PlayerGui:WaitForChild('Gui'):WaitForChild('Frame')
    frame.Visible = true -- Make it visible
    task.wait(5) -- Wait 5 seconds
    frame.Visible = false -- Make it invisible
end)

You could also do it on the client with a LocalScript, something like this:

script.Parent.Visible = true
task.wait(5)
script.Parent.Visible = false

(LocalScript in your frame)

Greetings. Thank you for your help. I made similar script to this. I tried it out but it does not work.
Thank you for trying to help. Have a nice day.

Is there any errors in the output window?

No, there are no errors in the output window.

One of the causes could be the GUI is not set to enabled, and another could be the script is just loading too fast. Try this:

game.Loaded:Wait()
script.Parent.Visible = true
task.wait(5)
script.Parent.Visible = false

Still not showing up. Well, the problem might be in the luau then.

I am also trying to make it so that it loads above another frame from the same gui and then disappear.

I tried using the ZIndex method, but still, it does not work.

it does probably work cause when you are loading to the game it probably runs it before you join it
in this part
players.PlayerAdded:Connect(function(plr)
try adding this below it
plr.Characteradded:Connect(function(char)

I tried it in the studio. Still does not work.

Did you checked the size and transparency is correct?

I also put the screengui that contains the frame to global. I also tried the ZIndex method.

Can you try making it visible in studio WITHOUT running the game or maybe the ScreenGui is not enabled

If this isn’t working than you have other problems. Look at the transparency settings and zIndex on both displays … also hide/remove the one over it for testing if needed. Hard to guess at your set up.

1 Like

The screen gui is enabled. I checked all of the stuff.

Hi, Put this into StarterPlayerScripts:

_P = game:GetService("Players")
_L = _P.LocalPlayer
_C = _L.Character



_S = _L:WaitForChild("PlayerGui"):WaitForChild("ScreenGui", 5)

	task.wait(1)
	_S.Enabled = true
	task.wait(5)
	_S.Enabled = false

Since this runs for the Player Only once, may work

You should be explaining the code that you reply with, instead of just spoon-feeding it. This is very vague.

@PhysicusX, have you figured out what the issue was, or are you still encountering this? It would be great if you gave us a model of the screen GUI.

Looking at the code, should be self explanatory, it isnt that much to where its confusing

Summary

Gets players service

Checks local player, scripts and such (i think?)

Checks character, physical

Checks local player for PlayerGui and ScreenGui

Delay

GUI Enabled

Delay

GUI Gone

Not the best at scripting, some of them (or all) might be wrong.

1 Like