Hello,
I've been trying to get this script to work for a long time. It's supposed to check if a player has a gamepass and execute some code, however this one line keeps throwing errors.
This script is in a ScreenGUI in StarterGUI
local plr = script.Parent.Parent.Parent.Parent
local first = script.Parent.First
first.MouseButton1Click:Connect(function()
if game:GetService('GamePassService'):PlayerHasPass(plr.Name, 966815211) then
-- Line has been removed to prevent copies
end
end)
The function "MouseButton1Click" is called and works fine, however the next line keeps throwing errors.
Yes, I've tried using MarketplaceService:PlayerOwnsAsset and in the output, it recommends using GamePassService:PlayerHasPass.
Any help would be much appreciated. :)

1 comment
wat is da error pls tell