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

Why isnt my Proximity Prompt script making my GUI visible?

Asked by
i_Rook 18
3 years ago

This script is not turning on the GUI. Where is the error in my script?

debounce = false
script.Parent.Triggered:Connect(function()
    if debounce == false then
        debounce = true
        script.Parent.Parent.Door_Open.Playing = true
        game.StarterGui.TransitionFadeGui.Frame.Visible = true
    wait(1.5)
        script.Parent.Parent.Door_Close.Playing = true
        game.StarterGui.TransitionFadeGui.Frame.Visible = false
    debounce = false
    end  
end)

Thanks.

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

You are changing it in starter gui so only new players will see it or if you reset. it should be in player.PlayerGui which you can get the player from the first param in triggered

debounce = false
script.Parent.Triggered:Connect(function(player)
    if debounce == false then
        debounce = true
        script.Parent.Parent.Door_Open.Playing = true
        player.PlayerGui.TransitionFadeGui.Frame.Visible = true
    wait(1.5)
        script.Parent.Parent.Door_Close.Playing = true
        player.PlayerGui.TransitionFadeGui.Frame.Visible = false
    debounce = false
    end  
end)

Ad

Answer this question