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

DataStore not saving data?

Asked by
NotSoNorm 777 Moderation Voter
9 years ago

Filtering enabled is on -Don't know if that matters or not

No errors it just won't save data

MoneyStore = game:GetService("DataStoreService"):GetDataStore("DataStore")

function PlayerEntered(player)
    repeat wait() until player.Character
    if MoneyStore:GetAsync("Money_"..player.Name) ~= nil then
        script.Parent.Parent.MoneyDisplay.Money.TextLabel.Text = MoneyStore:GetAsync("Money_"..player.Name)
    else
        script.Parent.Parent.MoneyDisplay.Money.TextLabel.Text = "1500"
    end

    script.Parent.Parent.MoneyDisplay.Money.TextLabel.Changed:connect(function(Text)
        MoneyStore:SetAsync("Money_"..player.Name, Text)
        print("Saved")
    end)
end

game.Players.PlayerAdded:connect(PlayerEntered)
0
It does, I have heard Server Side scripts do not work in [PlayerGui with] FilteringEnabled, and even if they do they do not have access to the PlayerGui. Edit: Fixed my message. M39a9am3R 3210 — 9y
0
Of course my script was in playergui lmao NotSoNorm 777 — 9y

Answer this question