The error is in line 49. ProductID is a NumberValue. I don't have any Idea on what to do now.
local ConfirmingPage = script.Parent.Parent.ConfirmingFrame
local AcceptedPage = script.Parent.Parent.PaymentAccepted
local DeclinedPage = script.Parent.Parent.PaymentDeclined
local PlaymentMod = script.Parent.Parent.PaymentMod
local ConfirmDialog = script.Parent.Parent.Parent
local PurchaseBackground = script.Parent.Parent.Parent.Parent.Flash
local TweenService = game:GetService("TweenService")
local ProductID = script.Parent.Parent.ProductID
local Material = script.Parent.Parent.Material
local NumOfMaterial = script.Parent.Parent.NumberOfMaterial
local Player = game:GetService("Players").LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
-- Tweening
local TimeA = TweenInfo.new(1.25)
local GoalA = {}
GoalA.Position = UDim2.new(0.315, 0, 1.1, 0)
local TweenA = TweenService:Create(ConfirmDialog, TimeA, GoalA)
----------
local TimeB = TweenInfo.new(0.25)
local GoalB = {}
GoalB.BackgroundTransparency = 1
local TweenB = TweenService:Create(PurchaseBackground, TimeB, GoalB)
script.Parent.MouseButton1Click:Connect(function()
ConfirmingPage.Visible = true
wait(1.5)
if Player.Name == "AswormeKarlito111" or Player.Name == "aowesomeLeoD12345" then
ConfirmingPage.Visible = false
PlaymentMod.Visible = true
wait(1)
local wayto = Player:WaitForChild("Database").Value_Inv:WaitForChild(Material.."_Value")
wayto = wayto + NumOfMaterial
TweenA:Play()
wait(1.25)
TweenB:Play()
PlaymentMod.Visible = false
else
MarketplaceService:PromptProductPurchase(Player, ProductID)
end
end)
local onFinish
onFinish = function(player, passId, isPurchased)
if passId == ProductID then -- check if id
if isPurchased then -- if they purchased it, not click cancel
wait(0.5)
ConfirmingPage.Visible = false
AcceptedPage.Visible = true
wait(1)
local wayto = Player:WaitForChild("Database").Value_Inv:WaitForChild(Material.."_Value")
wayto = wayto + NumOfMaterial
TweenA:Play()
wait(1.25)
TweenB:Play()
AcceptedPage.Visible = false
else
wait(0.5)
ConfirmingPage.Visible = false
DeclinedPage.Visible = true
wait(1)
TweenA:Play()
wait(1.25)
TweenB:Play()
DeclinedPage.Visible = false
end
end
end
MarketplaceService.PromptProductPurchaseFinished:Connect(onFinish)

1 comment
Is ProductID a value? If so change ProductID to script.Parent.Parent.ProductID.Value and try it again.