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

How do I Make a GUI Visible using Roblox's new Gamepass Live Changes?

Asked by 5 years ago

Ever since Roblox changed their game pass system on April 14 I'm having trouble making a GUI Visible, Let me Explain in detail; I want the script inside the Text Button to detect if the Player has the game pass, and if he/she does the Button will be Visible. Any Answers? I Would Like Some Help. I'm a beginner at scripting, so could I have some examples? Thank you!

1 answer

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

Check out the UserOwnsGamePassAsync method of the MarketplaceService here.

An example of use:

--LocalScript under StarterGui

local MpS = game:GetService"MarketplaceService"
local plr = game:GetService("Players").LocalPlayer
local passId = 0000000000 --PUT PASS ID HERE
local ScreenGui = -- PUT SCREENGUI HIERARCHY HERE (DISABLE IT)

if MpS:UserOwnsGamePassAsync(plr.UserId, passId) then
    ScreenGui.Enabled = true
end
0
Could I have an example? gam2010 9 — 5y
0
Sure. User#19524 175 — 5y
Ad

Answer this question