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

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
My god, it is messed up, it is mixing with the page D: UnknownGenerations 10 — 9y
0
Would you like me to edit it for you, get it to intentional formatting? M39a9am3R 3210 — 9y
0
I think I fixed it, it looks a bit better UnknownGenerations 10 — 9y
0
You're using GetAsync when you're trying to change a value on line 12. You would want to use SetAsync it appears. Also, keep the key the same, you're using "RoCash " instead of what you first searched for, which was "RoCash_". M39a9am3R 3210 — 9y
0
That didn't work,my friend is helping me though, so therefore problem solved UnknownGenerations 10 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

aaaaaaaaaaaaa

Ad

Answer this question