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

Why does this gamepass script not show the gui in Player?

Asked by 6 years ago
local id = 1228601465

game.Players.PlayerAdded:Connect(function(player)
local HasPass = game:GetService("GamePassService"):PlayerHasPass(player, id)
    if HasPass then
    print("Player has badge")
        player.PlayerGui:WaitForChild("TeleportGui").Frame.Title.Visible = true
    else
        player.PlayerGui:WaitForChild("TeleportGui"):Destroy()
    end
end)

1 answer

Log in to vote
0
Answered by
FazNook 61
6 years ago

My best guess would be that TeleportGUI.Frame.Visible = false rather than Frame's child. The script below should be the answer to your question.

SCRIPT

local id = 1228601465

game.Players.PlayerAdded:Connect(function(player)
local HasPass = game:GetService("GamePassService"):PlayerHasPass(player, id)
    if HasPass then
    print("Player has badge")
        player.PlayerGui:WaitForChild("TeleportGui").Frame.Visible = true
    else
        player.PlayerGui:WaitForChild("TeleportGui"):Destroy()
        print("Player does not have badge")
    end
end)

If this answered your question, make sure to upvote. Thank you!

0
the frame is actually visible, what its making visible is the text button CardboardedCharacter 53 — 6y
0
i did a different method to solve this but thanks anyway CardboardedCharacter 53 — 6y
0
I’m sorry, I was asleep. I’d have tended to this if I had noticed. FazNook 61 — 6y
Ad

Answer this question