---Important Things---
So I have a LeaderBoard and a Data Store that seems to not work with the LeaderBoard, but why? What went wrong in the scripts?
---Locations--- -TheData Store Script is in the ServerScriptService. -The Leaderboard is in the ServerScriptService.
---LeaderBoard (Working)---
game.Players.PlayerAdded:connect(function(p)
local stats = Instance.new("IntValue", p)
stats.Name = "leaderstats"
local cash = Instance.new("IntValue", stats)
cash.Name = "Cash"
cash.Value = 0
while true do
wait(30)
cash.Value = cash.Value + 50
end
end)
---Data Store(Not Working)---
local DSService = game:GetService("DataStoreService"):GetDataStore("vincentthecat1")
game.Players.PlayerAdded:Connect(function(Plr)
local uniquekey = 'id-'..Plr.userid
local LeaderBoard = Instance.new('IntValue',Plr)
local savevalue = Instance.new('IntValue')
LeaderBoard.Name = 'LeaderBoard'
savevalue.Parent = LeaderBoard
savevalue.Name = 'Cash'
end)

2 comments
I do not see any effort to save or get data. Read up: https://developer.roblox.com/en-us/articles/Data-store
Lacking critical information, making it very hard, if not impossible to fix your script.