this is my local script on a button in starter ui
local GamePassService = game:GetService('GamePassService') local CatGamepass = 26348478 local Player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() if GamePassService:PlayerHasPass(Player, 26348478) then Player.leaderstats.FaceValue.Value = "Uwu" Player.leaderstats.Hat.Value = "Uwu" else print("error") end end)
The :PlayerHasPass() method can only be used on the server and not in a local script/ the client. If you want to check from the client, I would do a RemoteFunction that returns the result of the method back to the client.
Here's an example with a RemoteFunction in the replicated storage.
Server script
local RemoteFunction = game.ReplicatedStorage:WaitForChild("Remote") local GamePassService = game:GetService('GamePassService') RemoteFunction.OnServerInvoker = function(Player, GamePassId) return GamePassService:PlayerHasPass(Player, GamePassId) end)
LocalScript
local RemoteFunction = game.ReplicatedStorage:WaitForChild("Remote") local HasPass = RemoteFunction:InvokeServer(26348478) --This will be true or false