its coming up with a error message saying " 20:50:56.931 - Players.cjkizzy286.Backpack.Milk.Script:6: attempt to perform arithmetic (add) on string and number" but if i change the value from a string to a int or number nothing happens the script wont run there are 2 bits of code
local data = game:GetService("DataStoreService")
local datastore = data:GetDataStore("Milk")-- name of it
local datastore = data:GetDataStore("Coins")-- name of it
local rebirth = game.Workspace.Values.Rebirthmultiplier
game.Players.PlayerAdded:Connect(function(Player)
local Leaderstats = Instance.new("Folder")
Leaderstats.Name = "leaderstats"
Leaderstats.Parent = Player
local Milk = Instance.new("StringValue",Leaderstats)
Milk.Name = "Milk"
Milk.Value = 0
local Coins = Instance.new("StringValue",Leaderstats)
Coins.Name = "Coins"
Coins.Value = 0
function Call()
local sell = Milk.Value
Coins.Value = Coins.Value + Milk.Value
Milk.Value = 0
end
end)
game.Players.PlayerRemoving:Connect(function(player)
datastore:SetAsync(player.UserId, player.leaderstats.Milk.Value)
datastore:SetAsync(player.UserId, player.leaderstats.Coins.Value)
end)
game.Workspace.Sell.Sellpart.Touched:Connect(function(touched)
Call()
end)
and
local Leaderstats = Instance.new("Folder")
local Milk = Instance.new("StringValue",Leaderstats)
local Coins = Instance.new("StringValue",Leaderstats)
script.Parent.Activated:Connect(function()
Milk.Value = Milk.Value + 1
end)

2 comments
like i said before when i replace them nothing happens
oof