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

How to Make a Textbutton use a script if the user has a certain gamepass?

I was wondering how to make a textbutton use a certain script but only use the script if the user has a certain gamepass.

1 answer

script is an example, not made to work as most of the variables arent defined.

-- detect when they use the button
textbutton.MouseButton1Click:Connect(function()
	-- checks if player owns the gamepass
	if marketplaceservice:UserOwnsGamePassAsync(userid, gamepassid) then
		--[[
		you know that they own the gamepass now
		add whatever you wanted to do here
		
		if you are using another script, you can use bindableevent:Fire() and bindableevent.Event:Connect()
		]]
	end
end)

next time, you should attempt to make a script before coming here.

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