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

GUI that shows only when you own a Gamepass?

Asked by
RoyMer 301 Moderation Voter
10 years ago

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.

0
script.Parent Aiden_12114 79 — 4y

1 answer

Log in to vote
1
Answered by 8 years ago
--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)
0
Thanks xD Quite an old question :P RoyMer 301 — 8y
0
np legomaster38 39 — 8y
Ad

Answer this question