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
11 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 — 5y

1 answer

Log in to vote
1
Answered by 9 years ago
01--This must be used in a script
02--As you can see I have made your code much neater then before.
03--Try it.
04 local id = 93044440
05game.Players.PlayerAdded:connect(function(player)
06    if local HasPass = Game:GetService("GamePassService"):PlayerHasPass(player, id) then
07player:findFirstChild("PlayerGui").Teleport.Visible = true else player:findFirstChild("PlayerGui").Teleport.Visible = false
08local x = Instance.new("Message",Workspace)
09x.Text = player.Name .. (HasPass and " has" or " doesn't have").. " the game pass!"
10wait(2)
11x:Remove()
12end
13end)
0
Thanks xD Quite an old question :P RoyMer 301 — 9y
0
np legomaster38 39 — 9y
Ad

Answer this question