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

How do you make a game pass connected button?

Asked by 5 years ago

I'm a fairly new scripter and make errors very often could you please check the following script for errors, it is a script for a game pass connected button

local gamePassId = 7691347

function vip(player) game:GetService("GamePassService") bool PlayerHasPass ( Player player, int gamePassId ) print(player.Name .. " has the game pass!") script.Parent.Parent.Parent.VIP.Value = "true" print(player.Name .. " doesn't have the game pass...") end end

vipbutton = script.Parent.Head vipbutton.Touched:connect(vip)

Thanks!

1 answer

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

Try this:

local passID = 0; -- put the gamepass ID here.

function vip()
    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game:GetService("Players").LocalPlayer.UserId, passID) then
        print("I bought the pass!"); -- Change this obviously.
    else
        print("I have not bought the pass."); -- Change this obviously. x2
    end;
end;

script.Parent.Head.vipbutton.Touched:Connect(vip);
0
Thanks! Sorry for the late response. kodakpro87 7 — 4y
Ad

Answer this question