Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why won't this DataStore work?

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)

5 comments

0

My god, it is messed up, it is mixing with the page D:

0

Would you like me to edit it for you, get it to intentional formatting?

0

I think I fixed it, it looks a bit better

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_".

0

That didn't work,my friend is helping me though, so therefore problem solved

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.