local MarketplaceService = game:GetService("MarketplaceService")
local ProductId = 1234567890 -- Change this ID with your Developer Product ID
script.Parent.MouseButton1Click:Connect(function()
MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer, ProductId)
end)
local DataStoreService = game:GetService("DataStoreService")
local LeaderstatDataStore = DataStoreService:GetDataStore("LeaderstatDataStore")
local DeveloperProductID = local MarketplaceService = game:GetService("MarketplaceService")
local ProductId = 1234567890 -- Change this ID with your Developer Product ID
script.Parent.MouseButton1Click:Connect(function()
MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer, ProductId)
end)
local DataStoreService = game:GetService("DataStoreService")
local LeaderstatDataStore = DataStoreService:GetDataStore("LeaderstatDataStore")
local DeveloperProductID = 1234567890 -- Change this ID with your Developer Product ID
game.Players.PlayerAdded:Connect(function(player)
local Leaderstat = player.leaderstats.Cash
local LeaderstatKey = player.UserId .. "_Coins"
local success, savedValue = pcall(function()
return LeaderstatDataStore:GetAsync(LeaderstatKey)
end)
if success and savedValue then
Leaderstat.Value = savedValue
end
local Purchased = false
game.Players.PlayerAdded:Connect(function(player)
local Leaderstat = player.leaderstats.Cash
local LeaderstatKey = player.UserId .. "Cash"
local success, savedValue = pcall(function()
return LeaderstatDataStore:GetAsync(LeaderstatKey)
end)
if success and savedValue then
Leaderstat.Value = savedValue
end
local Purchased = false
** You are now Level 12! **