I really don’t know what’s going on …
I made scripts more difficult than these and I had no problem with DataStore2, but this time I was not saving, I really don’t understand what is going wrong, and the script is not error!
here are all the scripts I quote “SkipSave” (StageSave saves correctly!)
(ServerScriptService)
local DataStore = require(1936396537)
local MarketplaceService = game:GetService("MarketplaceService")
function getPlayerFromId(id)
for i,v in pairs(game.Players:GetChildren()) do
if v.userId == id then
return v
end
end
return nil
end
MarketplaceService.ProcessReceipt = function(receiptInfo)
local productId = receiptInfo.ProductId
local playerId = receiptInfo.PlayerId
local player = getPlayerFromId(playerId)
local productName
local SkipsSave = DataStore("SkipsSave_V2", player)
if productId == 955834342 then
SkipsSave:Increment(1)
end
if productId == 955834530 then
SkipsSave:Increment(5)
end
if productId == 955835662 then
SkipsSave:Increment(10)
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
(Script in StarterGui)
local DataStore = require(1936396537)
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
local Bases = workspace:WaitForChild("Bases")
local SkipsSave = DataStore("SkipsSave_V2", player)
local StageSave = DataStore("StageSave_V3", player)
for i,v in pairs(Bases:GetChildren()) do
NumberOfStages = i
end
local Cooldown= false
script.Parent.MouseButton1Click:Connect(function()
if Cooldown== false then
Cooldown= true
script.Parent.Parent.Parent.Parent.Click:Play()
if SkipsSave:Get(0) > 0 and StageSave:Get(1)<= NumberOfStages then
---he's been active so far correctly!---
SkipsSave:Increment(-1)
StageSave:Increment(1)
end
wait(1)
Cooldown= false
end
end)
(Script in StarterGui)
local DataStore = require(1936396537)
local StageText = script.Parent
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
local SkipsSave = DataStore("SkipsSave_V2", player)
local function UpdateSkips(Value)
StageText.Text = "Skips: "..Value
end
UpdateSkips(SkipsSave:Get(0))
SkipsSave:OnUpdate(UpdateSkips)