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

How to make ScreenGUI appear and disappear after a few seconds?

GUI = game.StarterGui.LVL1GUI
brick = script.Parent

function activateGUI()
	GUI.Enabled = true
	wait(3)
	GUI.Enabled = false
end

brick.Touched:Connect(activateGUI)

I tried doing this but the GUI only appears after the player dies. Help pls thanks.

1 comment

0

Could we see your leaderstats script?

1 answer

✓ Accepted answer

don't change the gui in StarterGUI, each player has their own specific set of Gui that's from the StarterGui in their own "folder" called PlayerGui

local brick = script.Parent

brick.Touched:Connect(function(activate)
	local humanoid = activate.Parent:FindFirstChild("Humanoid")
	if humanoid then
		local player = game.Players:FindFirstChild(activate.Parent.Name)
		player.PlayerGui.LVL1GUI.Enabled = true
		wait(3)
		player.PlayerGui.LVL1GUI.Enabled = false
	end
	
end)

1 comment

0

Thanks!

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