I've made this script for somebody and I do not know if it will work or not. can somebody please tell me if it will work and if it wont, How to fix it? Thanks.
local id = script.Parent.ProductID
function onClicked (mouse)
local Humanoid = mouse.Parent:FindFirstChild("Humanoid")
if (Humanoid ~= nil) then
local Player = game.Players:GetPlayerFromCharacter(mouse.Parent)
game:GetService("MarketplaceService"):PromptProductPurchase(Player, id.Value)
end
end
script.Parent.ClickDetector.MouseClick:connect (onClicked)

2 comments
I believe that there are 2 scripts for it, What should the other one say?
this is the first script. where is your OTHER script that handles the purchase?