How To Make A Gamepass Button In Roblox Studio 2023
Описание
Script:
local MS = game:GetService("MarketplaceService")
local Gamepass = 172773740-- The ID of the Gamepass.
local OpenTrans = 1 -- The transparency of the button when it is bought.
local BuyGUI = true -- Set to false to stop the BuyGUI appearing.
-----------------------------------------------------------------------------------------------
local Button = script.Parent -- Button
-----------------------------------------------------------------------------------------------
Button.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if Gamepass = 0 then return nil end
if MS:UserOwnsGamePassAsync(plr.UserId, Gamepass) then
Button.CanCollide, Button.Transparency = false, OpenTrans
else
if BuyGUI == true then
MS:PromptGamePassPurchase(plr, Gamepass)
end
end
end
end)
Рекомендуемые видео


















