You are using StringValues, therefore you can't use the add function. Make sure you keep it IntValue.
Plus, you don't need to create another Instance of the leaderstats in the tool script.
This is what your scripts should look like:
1 | local Milk = game:GetService( "Players" ).LocalPlayer.Leaderstats.Milk.Value |
3 | script.Parent.Activated:Connect( function () |
Above is the local tool script.
01 | local data = game:GetService( "DataStoreService" ) |
02 | local datastore = data:GetDataStore( "Milk" ) |
03 | local datastore = data:GetDataStore( "Coins" ) |
04 | local rebirth = game.Workspace.Values.Rebirthmultiplier |
06 | game.Players.PlayerAdded:Connect( function (Player) |
07 | local Leaderstats = Instance.new( "Folder" ) |
08 | Leaderstats.Name = "leaderstats" |
09 | Leaderstats.Parent = Player |
11 | local Milk = Instance.new( "IntValue" ,Leaderstats) |
15 | local Coins = Instance.new( "IntValue" ,Leaderstats) |
20 | local sell = Milk.Value |
21 | Coins.Value = Coins.Value + Milk.Value |
27 | game.Players.PlayerRemoving:Connect( function (player) |
28 | datastore:SetAsync(player.UserId, player.leaderstats.Milk.Value) |
29 | datastore:SetAsync(player.UserId, player.leaderstats.Coins.Value) |
32 | game.Workspace.Sell.Sellpart.Touched:Connect( function (touched) |
Above is a serverscript.