Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a game pass connected button?

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

✓ Accepted answer

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);

1 comment

0

Thanks! Sorry for the late response.

This discussion is preserved as it was. New answers, comments, and votes are closed.