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

UserOwnsGamePassAsync "not able to cast int64"?

Asked by 4 years ago

Simple coding doesn't work. The error is

17:08:07.256 - Unable to cast Instance to int64 and so on, line 5 stack end

local market=game:GetService("MarketplaceService")
local player = game:GetService("Players").LocalPlayer
local button = script.Parent

if market:UserOwnsGamePassAsync(player,7218055) then
    button.Visible = true
else
    button.Visible = false
end

function activate()
        button.Parent.StoreFrame.Visible = not button.Parent.StoreFrame.Visible
end

script.Parent.MouseButton1Click:Connect(activate)

Am i using this function right? Why can't it get the "int64"?

(localscript)

1 answer

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

Try Player.UserId, not Player.

0
update: it worked thanks bro speedyfox66 237 — 4y
Ad

Answer this question