How to make a GUI that only appears ONCE

  1. What do you want to achieve?
    I’m making a tutorial/character selection system. I need…
    A GUI that does the following:
  • Appears only ONCE - this means that the first time the player joins the game, the GUI will appear, however the next time they join it won’t appear.
    *The GUI also only disappears forever if you click button inside the GUI, like accept etc…
  1. What is the issue?
    I have no clue where to start, due to lack of experience with these things.
  2. What solutions have you tried so far?
    None so far. I haven’t seen anything on DevForum. I was thinking about storing a string value or bool to the player with DataStore but this may be inefficient…

Thank you for your help. I’ll flag you as the solution if it works! :white_check_mark: :smiley_cat:

2 Likes

Using DataStore is the best way to be honest with you

2 Likes

@N0tA_G4m3r0nYT you must really regret your past self for that username :sob: , not that i’m any better (do NOT look at my past usernames)

but yes, datastores i think, can’t think of anything else

by default, there should be some sort of boolean stored in the datastore, that gets set to false whenever the player clicks the first-time GUI, i think that’s the only way

3 Likes

Disabled the respawn function of the GUI. It will then do just as you wish.

1 Like

Wdym my past self? :sob: my current username is just my yt username (im taking all the usernames close to it to avoid fake users lol) but yes using a Boolean and a remote event is the best way

1 Like

reset on death you mean?

that won’t work with rejoining though

so i was wrong…

i never said anyhing

1 Like

ResetOnSpawn is one of the options in the GUI’s properties. Uncheck that and it will only run the first time they log in. (Click on your GUI, look over at the properties window… uncheck ResetOnSpawn)

1 Like

you have to use datastore for this

store the gui in ReplicatedStorage or ServerStorage and clone it to the player’s PlayerGui

local playerService = game:GetService("Players")

local dss = game:GetService("DataStoreService")
local datastore = dss:GetDataStore("Anything here works")

local serverStorage = game:GetService("ServerStorage")
local gui = [path_to_gui]

playerService.PlayerAdded:Connect(function(plr)
	
	local tempData
	local success, errMsg = pcall(function()
		tempData = datastore:GetAsync(plr.UserId..'data')
	end)
	
	if success and tempData then
		--Player has played the game before
		--load other data or sm
	else
		--If player is new
		local newGui = gui:Clone()
		newGui.Parent = plr.PlayerGui
		datastore:SetAsync(plr.UserId..'data', true)
	end
end)

wrote this in the forum so there might be errors and bad optimization but this is basically how it should work

3 Likes

If you’re not relying on datastores for anything else, you can just use a welcome badge for this. When someone without the badge joins, show the GUI and award that badge. Only problem is that players can force it to show again by removing it from their inventory.

2 Likes

I’ll try this out! I’ll let you know if it works

You’ve been marked as the solution! Thank you, and everyone else who replied on this forum!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.