Unable to cast Instance to int64

I get “Unable to cast Instance to int64” at line 10. I do not know what the problem is. Here’s my code:

wait(2)
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local walkId = 182684938
local doesntOwn = true
local plrmodule = script.Parent.PlayerModule
local controls = require(plrmodule.ControlModule)

while doesntOwn == true do
	if mps:UserOwnsGamePassAsync(player,walkId) then
		doesntOwn = false
		controls:Enable()
	end
end
-- Please ignore my game idea

Also I don’t think there’s anything wrong with the walkId because the id works in other scripts. Can someone help me?

you passed game.Players.LocalPlayer into mps:UserOwnsGamePassAsync(), when the command requires the userID of Player.LocalPlayer

So on line 10 just replace “player” with “player.UserId”

Wow thanks, I didn’t notice that small problem.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.