Hello. I've recently been trying to get a script that allows a player to buy a gamepass if they step on a certain brick
I know it has to include
game:GetService("MarketplaceService"):PromptGamePassPurchase
Or something like that, its just when i'm trying to get it work when you step on a brick, Does anyone know a working script?
Hi, i'm BashGuy10. Hopefully i can help you!
Problem?
You don't know how to make a brick prompt you to buy a gamepass?
Fixes
It's really simple, just do :PromptGamePassPurchase(plr, gamepassid)
.
Also if it doesn't work use :PromptGamePassPurchase(gamepassid, plr)
Some info: plr, is the player instance. gamepassid is the string of numbers found in the URL for the gamepass.
Here are some link to help you out:
:PromptGamePassPurchase(plr, gamepassid)
Example Fix
By the way, this is a server script. k
local gamepassid = 0 -- ID Here script.Parent.Touched:Connect(function(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) -- Code here end)
Try this script!
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then game.Players.LocalPlayer.PlayerGui.guiname.Frame.Visible = true end end)