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

Why won't this DataStore work?

Asked by 9 years ago

--Note that the 'RoCash' Value is NOT a leaderstat

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

function PlayerEntered(player) repeat wait() until player.Character

local rocash = game.Workspace.Screen.RoBox.Robux

if store:GetAsync("RoCash_"..player.Name) ~= nil then
    rocash.Value = store:GetAsync("RoCash "..player.Name)
else 
    rocash.Value = 0        
end

rocash.Changed:connect(function(Val)
    store:GetAsync("RoCash "..player.Name, Val)
    rocash.Value = rocash.Value
end)

end

game.Players.PlayerAdded:connect(PlayerEntered)

0
script is kinda messed up, its mixed with the page, sorry about that :/ UnknownGenerations 10 — 9y

Answer this question