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

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

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

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!

3 comments

0

the frame is actually visible, what its making visible is the text button

0

i did a different method to solve this but thanks anyway

0

I’m sorry, I was asleep. I’d have tended to this if I had noticed.

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