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

GUI that shows only when you own a Gamepass?

local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass

function check() if game:GetService("GamePassService"):PlayerHasPass(player, passId) then plr.PlayerGui.Teleport.Visible = true else plr.PlayerGui.Teleport.Visible = false end end

game.Players.PlayerAdded:connect(function(plr) if game:GetService("GamePassService"):PlayerHasPass(player, passId) then plr.PlayerGui.Teleport.Visible = true else plr.PlayerGui.Teleport.Visible = false end plr.CharacterAdded:connect(function() check() end) end) -- By RoyMer, Edited by: awas3

This Gamepass used to work a year ago but for some reason it's not working now, it is supposed to check if you own the gamepass and if you own it, it will allow you to see the GUI, and if you do not own the gamepass, it doesn't show the GUI.

1 comment

0

script.Parent

1 answer

✓ Accepted answer
--This must be used in a script
--As you can see I have made your code much neater then before.
--Try it.
 local id = 93044440
game.Players.PlayerAdded:connect(function(player)
    if local HasPass = Game:GetService("GamePassService"):PlayerHasPass(player, id) then
player:findFirstChild("PlayerGui").Teleport.Visible = true else player:findFirstChild("PlayerGui").Teleport.Visible = false
local x = Instance.new("Message",Workspace)
x.Text = player.Name .. (HasPass and " has" or " doesn't have").. " the game pass!"
wait(2)
x:Remove()
end
end)

2 comments

0

Thanks xD Quite an old question :P

0

np

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