Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Paradoa 17
4 years ago
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.

0
Could we see your leaderstats script? apexslab 15 — 4y

1 answer

Log in to vote
0
Answered by
0msh 333 Moderation Voter
4 years ago
Edited 4 years ago

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)
0
Thanks! Paradoa 17 — 4y
Ad

Answer this question