#script is not working

27 messages · Page 1 of 1 (latest)

woeful zephyr
#

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
timid hamlet
#

first

woeful zephyr
#

i tried making a script that if you purchase a product

#

it gives you cash

timid hamlet
woeful zephyr
#

huh

timid hamlet
#
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

there now its easier to fix

woeful zephyr
#

oh thanks

timid hamlet
#

but uh

#

thats a lot

woeful zephyr
#

yeah

timid hamlet
#

unnecessarily a lot

woeful zephyr
#

i just tried to make a product button that gives you cash

timid hamlet
#

yeah.

#

i have the.

worldly meteorBOT
#

studio** You are now Level 12! **studio

timid hamlet
#

code for it

woeful zephyr
#

you do?

#

that would help

timid hamlet
#

but kinda lazy and easy for it

#

ive done it using dev products

#

but it kinda broke

#

idk why

woeful zephyr
#

eh

timid hamlet
#

it did it every time the person rejoined

woeful zephyr
#

oh

#

i feel that