How to make a GUI only appear once?

Hello I am making a starting tutorial for my game and I dont know how to make it so the tutorial gui only appears when you first join the game,

It would be nice to help!

Store data on the player seeing if it their first time.

If yes, make the GUI and upon completion of the tutorial save that they have done it.

If no, continue with the next task.

ok yeah thats tha part im stuck with though

Use datastores.
Have the client wait for the server to load data, if there is no prior data, make the tutorial appear on the client.
If there is prior data, then don’t.

The API reference should always be your first go-to.

I would save it as @VitaIStorm says, and I would also add a remote function to return whether they have done it before or not.

--client script
local getdone = --remote function

local hasdone = getdone:InvokeServer()

if not hasdone then
	print("Hasn't finished tutorial")
else
	print("Has done tutorial")
end

Server script

local getdata = --remote function
local knowndata = {}
local ds = game:GetService("DataStoreService"):GetDataStore("TutorialData")

getdata.OnServerInvoke = function(plr)
	if table.find(knowndata, plr) then
		return true
	else
		table.insert(knowndata, plr)
		return ds:GetAsync(plr.UserId) or false
	end
end

Also, you’ll want to have a way to save the finish as well

The easiest way is to check if player has the “tutorial completion” badge

1 Like

A badge would work great, + badges can also in a way help advertise your game, I actually often find games when I see somebody’s badges on somebody else’s profile. Might just be me though.
Also helpful cause badges are now free, thankfully

1 Like

OK thanks for the Help! ill try making a tutorial badge (sorry for being late)

Though I am stuck, how would I get if the user owns badge?

MS = game:GetService("MarketPlaceService")
local function CheckforBadge(player)
	local haspass = MS:UserHasBadgeIdAsync(player.UserId, 34787093)
	if haspass then
		script.Parent.Visible = false
	else
		script.Parent.Visible = true
	end
end

would that work?

if you want to check if the player owns the badge don’t use MarketPlaceService, instead use BadgeService.

Ok! thanks!

sfshfwehufhiuwhefiu

1 Like

Use Datastores for this. When a player joins the game for the first time save a key under their userid. The game will check for this key when the player joins and if it finds it then the GUI will not be visible, and if the game doesn’t find a key then it will create one

sorry guys but im stuck on making the awardbadge gui part

I cant figure to make it when the player clicks a textbutton and get a badge tho

If you’re making the game check if a player has a badge to decide to show the GUI then that is a bad idea. Players can remove badges from their inventory, making the game check, not detect it and give you a new badge. This can be bad if you’re using badges to store important data.

Yeah I kinda figured that, Instead I just made an info block so yeah.

thanks for yall support