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

How do you make a GUI appear when you have a Game Pass???

Asked by 7 years ago

Please help me. I am not sure of what to do without a script for this.

0
Hello. Could you please specify... Has the ScreenGui any Buttons on it or they're just frames and images? Aimarekin 345 — 7y
0
You need to be more specific. Show your code to prove that you've tried, this isn't a request site. SebbyTheGODKid 198 — 7y
0
it's a frame connected from a script. I will give it when I get my computer! I don't have any code before SGYTMinersHaven -16 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Just try this:

passId = 1337 -- Change to your gamepass
game.Players.PlayerAdded:connect(function(plr)
    plr:WaitForDataReady()
    if game:GetService("GamePassService"):PlayerOwnsPass(plr,passId) then
        plr.PlayerGui.MyGui.MyFrame.Visible = true -- Change to your own hierarchy
    else
        print(plr.Name .. " does not have the pass.")
    end
end)

From a ServerScript in workspace, or ServerScriptService

Always try to look for a wiki page with your problem, before asking.

Ad

Answer this question