Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

DataStore and/or IntValue is not working?

Asked by 4 years ago
Edited 4 years ago

So, i was working on obbies beaten amount, but when player finished the obby, value doesn't increase

dataStore = game:GetService("DataStoreService")
SoHStore = dataStore:GetDataStore("SoHStore")
db = false

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        if db == false then
            db = true
            local player = game.Players:GetPlayerFromCharacter(hit.Parent)
            local co = SoHStore:GetAsync(player.userId)

            if co == false then
                SoHStore:SetAsync(player.userId,true)
                player.leaderstats.Steeples.Value = player.leaderstats.Steeples.Value + 1
            end

            player:LoadCharacter()
            wait(6)
            db = false
        end
    end
end)

What is wrong with the script?

0
if co == false then, Why are you checking if its false? that will only increase the value if getasync didnt receive any data Azure_Kite 885 — 4y
0
i am making so, that player won't try to get more amount of obbies beaten just from 1 obby megamanyoutuber 25 — 4y

Answer this question