****Hi! I’m a new member here! I was working on a new project known as “Combat Shooter” but the business isn’t going well so I ended up leaving it behind. I only know how to change the behavior on a part with a script and I was looking up for gamepasses with a click detector in it on the internet but none of it seems to work for me
local Click = script.Parent
local GamePassID = 000000 -- Change this to your Gamepass ID.
Click.MouseClick:connect(function(player)
game:GetService("MarketplaceService"):PromptPurchase(player,GamePassID)
end)
You will need to put a click detector inside the model/part that you want the player to click & then make a script inside the Model or ServerScriptService, but to keep it clean, you can make it in the model.
Then you could script it up something like this:
local Detector = script.Parent:FindFirstChildOfClass("ClickDetector")
local gamepassID = 21414124 --Your Gamepass ID
local MarketplaceService = game:GetService("MarketplaceService")
Detector.MouseClick:connect(function(player) --MouseClick event automatically passes the player who clicked it.
MarketplaceService:PromptGamePassPurchase(player, gamepassID ) -- You then prompt the gamepass purchase prompt to that person who clicked it.
end)