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

How do you make a gui that only apears once?

how to make a gui that only apears once and it doesnt come even if you rejoin the game, but it saves every weapon you have, i tryed this:

game.Players.PlayerAdded:connect(function(player) repeat wait() until player --code end)

but it didnt work also tell me where to put the script if you give me one :)

1 answer

✓ Accepted answer

do this then

function LoadStat(Player, Stat) -- function for Loading the bool
	if pcall(function()  Player:LoadBoolean(Stat.Name) end) then
		return Player:LoadBoolean(Stat.Name)
	else
		return false
	end
end

game.Players.PlayerAdded:connect(function(Player)
	--Other code
	if Player:WaitForDataReady() then -- wait tell Data is ready for use
	local Intro = Instance.new("BoolValue", Player)
	Intro.Name = "Intro"
	Intro.Value = LoadStat(Player, Intro) -- load the intro stat
	end
end)

game.Players.PlayerRemoving:connect(function(Player) 
	if Player.DataReady then
		Player:SaveBool(Player.Intro.Name, Player.Intro.Value) -- saves the intro Structure: :LoadBoolean(Key, Value), Key is the string name and the value is the value you wish to set it as.
	end
end)

after this make a local script and put it in your intro

local Player = game.Players.LocalPlayer
local Intro = Player:WaitForChild("Intro")

if Intro.Value == true then
	script.Parent["FrameName"].Visible = true -- Set "FrameName" as the frame that holds all the intro stuff
else
	script.Parent["FrameName"].Visible = false
end

4 comments

0

Where do i put the script?

0

In the serverscriptservice

0

Do i name the Gui Intro?

0

I edited it

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