Hello, im trying to make a purchase manager and everything works fine in it BESIDE the gamepasses when checking if UseOwnsGamePassAsync i get Instance not cast to int64 error help need thanks!
v.Head.Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if v.Head.CanCollide == true then if player ~= nil then if script.Parent.Owner.Value == player then if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent.Humanoid.Health > 0 then local PlayerStats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name) if PlayerStats ~= nil then if (v:FindFirstChild('Gamepass')) and (v.Gamepass.Value >= 1) then if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player,v.Gamepass.Value) then Purchase({[1] = v.Price.Value,[2] = v,[3] = PlayerStats}) else game:GetService ("MarketplaceService"):PromptGamePassPurchase(player,v.Gamepass.Value) end
V is just a value that is open for whenever its needed
Check the documentation for UserOwnsGamePassAsync.
The first argument is a user id, not a Player
instance.
:UserOwnsGamePassAsync(player.UserId, v.GamePass.Value)