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.
01 | plr = game.Players.LocalPlayer |
02 | script.Parent.MouseButton 1 Click:connect( function () |
03 | if game:GetService( "GamePassService" ):PlayerHasPass(plr, 12356 ) then |
04 | print ( "Has pass" ) |
05 | else |
06 | if game:GetService( "GamePassService" ):PlayerHasPass(plr, 124578 ) then |
07 | print ( "Has Pass2" ) |
08 | else |
09 | print ( "Has no pass" ) |
10 | end |
11 | end |
12 | 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.