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

2 comments
Thanks for the quick answer ill try it out
I get the error attempt to index field 'UserId' (a number value)