I have a data Store, but why wont it work?
---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)---
01 | game.Players.PlayerAdded:connect( function (p) |
02 | local stats = Instance.new( "IntValue" , p) |
03 | stats.Name = "leaderstats" |
04 | local cash = Instance.new( "IntValue" , stats) |
09 | cash.Value = cash.Value + 50 |
---Data Store(Not Working)---
01 | local DSService = game:GetService( "DataStoreService" ):GetDataStore( "vincentthecat1" ) |
02 | game.Players.PlayerAdded:Connect( function (Plr) |
04 | local uniquekey = 'id-' ..Plr.userid |
05 | local LeaderBoard = Instance.new( 'IntValue' ,Plr) |
06 | local savevalue = Instance.new( 'IntValue' ) |
07 | LeaderBoard.Name = 'LeaderBoard' |
08 | savevalue.Parent = LeaderBoard |
09 | savevalue.Name = 'Cash' |