Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont my script work after following a tutorial?

Asked by
dxrrevn 13
3 years ago

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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Luau is cap sensitive

UserOwnsGamePassAsync
Ad

Answer this question