local function onMouseClick(player) local Points = player.leaderstats.Points
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserID,000000) then Points.Value = Points.Value + 250 else print("Player doesnt have gamepass") end end
script.Parent.ClickDetector.MouseClick:connect(onMouseClick)
It's A Very Simple Error, and a mistake the best of us make. You added a capital where a capital shouldn't be xD. It's "UserId" not "UserID"
Here's Your Script Rewritten:
local function onMouseClick(player) local Points = player.leaderstats.Points if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,000000) then Points.Value = Points.Value + 250 else print("Player doesnt have gamepass") end end script.Parent.ClickDetector.MouseClick:connect(onMouseClick)