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

UserOwnsGamePassAsync "not able to cast int64"?

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

✓ Accepted answer

Try Player.UserId, not Player.

1 comment

0

update: it worked thanks bro

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