Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why wont my script work after following a tutorial?

Okay, so I'm making a Clicking Simulator game, and I'm doing an increment value for the gamepass(es) you buy. My script below contains no errors on my end:

local IncVal = script.Parent.IncrementValue
local Gamepass2xClicksID = 12345 -- TempValue
local Gamepass5xClicksID = 123456 -- TempValue
local Gamepass10xClicksID = 1234567 -- TempValue
local Player = game.Players.LocalPlayer

IncVal.Value = 1
if game:GetService("MarketplaceService"):UserOwnsGamepassAsync(Player, Gamepass2xClicksID) then
	IncVal.Value = 2
elseif game:GetService("MarketplaceService"):UserOwnsGamepassAsync(Player, Gamepass5xClicksID) then
	IncVal.Value = 5
elseif game:GetService("MarketplaceService"):UserOwnsGamepassAsync(Player, Gamepass10xClicksID) then
	IncVal.Value = 10

script.Parent.MouseButton1Click:Connect(function()
	Player.leaderstats.Clicks.Value = game.Players.LocalPlayer.leaderstats.Clicks.Value + IncVal.Value
	end)
end

and in Output when I play the game, I get this notification:

UserOwnsGamepassAsync is not a valid member of MarketplaceService "MarketplaceService"

In the video tutorial I watched, the creator had no errors. Can someone explain to me what the problem is and how I can resolve it?

1 answer

Luau is cap sensitive

UserOwnsGamePassAsync

This discussion is preserved as it was. New answers, comments, and votes are closed.