I'm trying to make a button where it would check to see if you have a game pass and if you don't it will check if you have another. Could someone fix this for me?, thanks in advance.
plr = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() if game:GetService("GamePassService"):PlayerHasPass(plr, 12356) then print("Has pass") else if game:GetService("GamePassService"):PlayerHasPass(plr, 124578) then print("Has Pass2") else print("Has no pass") end end end)
A player owning a game pass can not be checked using a local script, which I assume you are using because plr = game.Players.LocalPlayer. You will need to have a regular script check for that person's game passes and return to that script its answer for that local script to deal with it. I suggest inserting values in to each other's script for data to be transferred (such as the player's name, and when sent back the answer). Or you could make this a lot easier and just have it all in a normal script.
Just make separate scripts, because both will be read at the same time. Unless, you need one pass to have another, that's different.