It Doesn't Work
01 | local datastore = game:GetService( "DataStoreService" ) |
02 | local ds 1 = datastore:GetDataStore( "winsSaveSystem" ) --change all "wins" to what value you want and keep doing it |
03 | local Debounce = tick() -- Assign tick() to the variable |
04 | game.Players.PlayerAdded:connect( function (player) |
05 | local folder = Instance.new( "Folder" , player) |
06 | folder.Name = "leaderstats" |
07 | local wins = Instance.new( "IntValue" , folder) |
08 | wins.Name = "Wins" |
09 | wins.Value = ds 1 :GetAsync(player.UserId) or 0 |
10 | ds 1 :SetAsync(player.UserId, wins.Value) |
11 |
12 | workspace.Lobby.DROPDOWN.Winner.Touched:Connected( function () |
13 | if (tick() - Debounce) > = 5 then -- Make sure 5 seconds have elapsed since last debounce |
14 | Debounce = tick() |
15 | wins.Value = wins.Value + 1 |
01 | local datastore = game:GetService( "DataStoreService" ) |
02 | local ds 1 = datastore:GetDataStore( "winsSaveSystem" ) |
03 | local Debounce = tick() |
04 | game.Players.PlayerAdded:Connect( function (player) |
05 | local folder = Instance.new( "Folder" ) |
06 | folder.Parent = player --second argument of .new() deprecated |
07 | folder.Name = "leaderstats" |
08 | local wins = Instance.new( "IntValue" ) |
09 | wins.Parent = folder |
10 | wins.Name = "Wins" |
11 | wins.Value = ds 1 :GetAsync(player.UserId) or 0 |
12 | ds 1 :SetAsync(player.UserId, wins.Value) |
13 |
14 | workspace.Lobby.DROPDOWN.Winner.Touched:Connect( function () --not Connected |
15 | if (tick() - Debounce) > = 5 then |