I tryed making a script to save a value to show a gui only the first time a player plays but it doesn't work..... This is Workspace:


function CreateSave(plr)
	if plr:WaitForDataReady() then
		wait(0.03)	
		plr:SaveBoolean("PlayerPlayed_test", false)
		
		local PlayerPlayedData = plr:LoadBoolean("PlayerPlayed_test")
		local PlayerPlayed = Instance.new("BoolValue")
		PlayerPlayed.Name = "PlayerPlayed"
		PlayerPlayed.Parent = plr	
		PlayerPlayed.Value = PlayerPlayedData
	end
end

game.Players.PlayerAdded:connect(CreateSave)

This is in the Gui, in StarterGui:


function ShowGui(plr)
	if plr.PlayerPlayed == false then
		script.Parent.Visible = true
		
		script.Parent.MouseButton1Click:connect(function()
			script.Parent.Visible = false
		end)
	end
end

game.Players.PlayerAdded:connect(ShowGui)

2 comments

0

Why not just clone the GUI to the PlayerGui on PlayerAdded, waiting for the PlayerGui to exist before setting the GUI's parent? It's much faster and easier.

0

Ok, I'll try that...