Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make a tutorial gui that pops up once and never again?

So i been trying to make a tutorial when you join once and never again.If somebody knows how to do that can you post the script cause im a new scripter. i can script decent but im not that good with events.Thanks!

6 comments

0

Which part do you want me to explain?

0

Look, you may have all that stuff, but I don't know what scripts are inside each tutorial, so I can't help. Also, you did not ask for that kind of help in your question. If you want me to specifically help you, I need the scripts that are involved in it!

0

Look, you may have all that stuff, but I don't know what scripts are inside each tutorial, so I can't help. Also, you did not ask for that kind of help in your question. If you want me to specifically help you, I need the scripts that are involved in it!

0

Look, you may have all that stuff, but I don't know what scripts are inside each tutorial, so I can't help. Also, you did not ask for that kind of help in your question. If you want me to specifically help you, I need the scripts that are involved in it!

0

Look, you may have all that stuff, but I don't know what scripts are inside each tutorial, so I can't help. Also, you did not ask for that kind of help in your question. If you want me to specifically help you, I need the scripts that are involved in it!

0

uhhh.. i think i can help...

2 answers

Alright so what I am about to say is COMPLETELY just a thought. It might or might not work, but I am just trying to use my brain. Hehe

So what I am going to use is a DataStore to save a true/false variable. If the value is true, then the gui shows up. But after you are done with the tutorial, the true variable turns to false and the gui won't pop up. You will have to script the done part yourself!

Anyway add a Script into ServerScriptService and write this:

local DataStoreService = game:GetService("DataStoreService") -- Gets the DataStoreService
local dataStore = DataStoreService:GetDataStore("AnythingYouWantToNameIt") -- Getting data stored in the key. If there is no data, data will be saved later on!
local debounce = true -- This is to notify whether gui should be on or off

game.Players.PlayerAdded:Connect(function() -- When a player is added...
	local valueLoaded = dataStore:GetAsync("AnyKeyYouWant") -- valueLoaded will equal to whatever data is in the key AnyKeyYouWant
	print("Loading debounce as:", valueLoaded) -- This is for testing
end)

if debounce then -- If debounce == true then
	--Gui is on
	if guiEnded then -- You will have to script this part yourself as I don't know what is in your tutorialGui
		debounce = false
	end

end

if debounce == false then
	--Gui is off
end

game.Players.PlayerRemoving:Connect(function() -- When a player is leaving
	local valueSaved = debounce -- Value saved will become the value of debounce. This means that if debounce was false, the valueSaved will be false
	print("Saving debounce as: ", valueSaved) -- Testing purposes. Will be shown in Output
	dataStore:SetAsync("AnyKeyYouWant", valueSaved) -- Sets the data
end)

Hopefully this works. If not, please tell me with the output error.

5 comments

0

can u explain a bit more i dont understand

1

haha get roasted

0

Do you have to be that mean @incapaz ?

0

anyway in my gui i have: The Name of the gui is Tutorial and in the gui itself i have Tutorial1,Tutorial2,Tutoria3,Tutorial4,Tutorial5,Tutorial,6

0

+SnekyGodZ You can save yourself time by using one TextLabel and changing it with a script. +Lightning_Game27 That is a bit of a redundant script. In my script you just have to check for a nil value whilst yours you go through some stuff that might not even be necessary to begin with

It can be much simplier. Since I'm feeling nice, I'll provide a script for you.

--This is a module script.

local KeyData = {
	Key = "54H6366B6B5663" --A random string. Change this key to reset your datastore anytime
	Version = "1" --Allows you to change versions and revert back whenever you want
}
return KeyData
--Server script in ServerScriptService
local KeyData = require(game.ServerScriptService.ModuleScript)
local DSS = game:GetService("DataStoreService")
local new = DSS:GetDataStore(KeyData.Key.."-"..KeyData.Version.."-NewPlayer")

game.Players.PlayerAdded:Connect(function(player) --When a player joins
	local newplr = Instance.new("NumberValue") --Create a new value in their instance
	newplr.Name = "NewPlr"
	newplr.Parent = player
	
	if new:GetAsync(player.UserId, newplr.Value) == nil then --If the player does not have any data
		--your code here, etc etc
		newplr.Value = 1
		new:SetAsync(player.UserId, newplr.Value) --You could do this after the player finishes the tutorial
	end
end)

3 comments

0

hello where should i make the script in?

0

wait so the module script where should it be?

0

I would put it in ServerScriptService.

This discussion is preserved as it was. New answers, comments, and votes are closed.