Any idea why this playeradded script isn't working in an FE or non-FE game?
I have a localscript in StarterGui with the following code.
01 | local passId = 900915415 |
03 | function authenticate(player) |
04 | return game:GetService( "GamePassService" ):PlayerHasPass(player, passId) |
07 | game.Players.PlayerAdded:Connect( function () |
08 | if authenticate(game.Players.LocalPlayer.Character.Name) then |
09 | game.Players.LocalPlayer.PlayerGui.PremiumShop.Enabled = true |
10 | game.Players.LocalPlayer.PlayerGui.Shop.Enabled = false |
12 | game.Players.LocalPlayer.PlayerGui.PremiumShop.Enabled = false |
13 | game.Players.LocalPlayer.PlayerGui.Shop.Enabled = true |
There are no output errors.
I want the script to enable the premium shop if the player has the gamepass, and the normal shop if the player doesn't have the gamepass upon joining. This script doesn't work in a FE game or non-FE game. Any feedback would be appreciated, thanks!