So I want by clicking on the donate button, the player could donate and make a free (for donation) rebirth. But for some reason, this happens:
Why? Here’s the script, note the donateRebirth function
local player = game:GetService("Players").LocalPlayer
local ld = player:WaitForChild("leaderstats")
local damage = ld.Damage
local rebirth = ld.Rebirth
local main = script.Parent
local button = main.makeRebirth
local donateButton = main.DonateRebirth
local MPS = game:GetService("MarketplaceService")
local devproductId = main.devproductId.Value
local function makeRebirth()
if damage.Value >= main.forRebirth.Value then
game:GetService("SoundService").Click:Play()
rebirth.Value += 1
damage.Value = damage.Value - main.forRebirth.Value
end
end
local function donateRebirth()
MPS.PromptProductPurchaseFinished(player, 1570916668)
game:GetService("SoundService").Click:Play()
rebirth.Value += 1
end
button.MouseButton1Click:Connect(makeRebirth)
button.TouchTap:Connect(makeRebirth)
donateButton.MouseButton1Click:Connect(donateRebirth)
donateButton.TouchTap:Connect(donateRebirth)
if anything, this is a locale script that is in the GUI
Again, this is what I want to do. The player donates and gets free rebits without spending power and so on. Again, he has to donate, and then if he wants he can donate and get a second rebirth. So this is not a gamepass and he can do this an infinite number of times
I’ll tell you right away that I read the documentation and did everything as it says, here:
But for some reason I still get this error