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

How to use UserOwnsGamePassAsync?

Asked by 4 years ago

So im trying to use this to make a nuke and its not working. Here is some of my code:

local Click = script.Parent.Click
local ClickDetect = Click.Detector
local NukePosParent = script.Parent.BIGNUKE
local mar = game:GetService("MarketplaceService")
local Num = 6089351

ClickDetect.MouseClick:connect(function(p)
    if mar:UserOwnsGamePassAsync(p, Num) then
        local Nuke = Instance.new("Part")
        Nuke.Parent = script.Parent
        Nuke.Position = NukePosParent.Position
        while true do
            Nuke.Size = Nuke.Size + Vector3.new(1,1,1)
            wait(.1)
        end
        else mar:PromptGamePassPurchase(p, Num)
    end
end)

1 answer

Log in to vote
1
Answered by
pwx 1581 Moderation Voter
4 years ago

Use Player.UserId, not player.

0
Lemme try that User#29913 36 — 4y
0
This is going to do good! User#29913 36 — 4y
Ad

Answer this question