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)
COMMUNITY QUESTION
Why does this gamepass script not show the gui in Player?
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!
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
the frame is actually visible, what its making visible is the text button
i did a different method to solve this but thanks anyway
I’m sorry, I was asleep. I’d have tended to this if I had noticed.