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

How do I make it so if a player has a game pass the GUI is visible?

I tried many different things and it just says "unable to cast int64" or something.

local Player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function(player)
	script.Parent.Parent:FindFirstChild("Menu").Visible = not script.Parent.Parent:FindFirstChild("Menu").Visible
	script.Parent.Parent:FindFirstChild("Shop").Visible = false
	script.Parent.Parent:FindFirstChild("Information").Visible = false

-- This is what I need help with:
	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player,9902217) then
			script.Parent.Parent("Menu").TeamSelection.Visible = true
		end
end)

1 answer

✓ Accepted answer

UserOwnsGamePassAsync accepts a user id instead of a player object. You can access that by doing Player.UserId. Also, it should be

script.Parent.Parent.Menu.TeamSelection.Visible = true

2 comments

0

Mwah

0

^^^

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