So basically I’m trying to figure out when you buy a gamepass that you get a GUI on your screen like forever, so if you leave and come back that you still have the GUI, that’s a great example of when you buy a radio gamepass, you want them to obviously play the radio so they need a GUI on screen.
1 Like
do you want to send a script for this?
and step by step tutorial?
1 Like
local YourGamePassID = 0 -- Your GamepassID
game.Players.PlayerAdded:Connect(function(plr)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,YourGamePassID) -- Checks if the player Has The Gamepass.
local YourGui = Gui:Clone() -- Clones The Gui
YourGui.Parent = plr.PlayerGui -- Parents It to the player's Instance
else
game:GetService("MarketplaceService"):PromptGamePassPurchase(plr,YourGamePassID) -- Prompt The Gamepass to the player.
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,YourGamePassID,IsPurchased) -- Cheks if the Prompt Purchase is Finished.
if IsPurchased then -- If Player Purchased the Gamepass Then
local YourGui = Gui:Clone() -- Clones The Gui
YourGui.Parent = plr.PlayerGui -- Parents It to the Player
end
end
end)
1 Like
Thats the thing I dont have the script
Im gonna see tomorrow if it works
1 Like
Try to use the search feature in future.
2 Likes
Where do I put that script exactly?
1 Like
I see you did not open the post, I will quote what is at the bottom:
1 Like
ServerScriptService would work fine.
1 Like
That has a bunch of errors when I insert that script
a script would be nice
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee