So I just have 3 different things in my leaderstats called oil, what im trying to sell, money what oil needs to become and companyvalue but that has nothing to do with it.
here is the script of my seller: ~~~~~~~~~~~~~~~~~ local multiplier = 1 local db = false
script.Parent.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then if not db then db = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.leaderstats.Money.Value = plr.leaderstats.Money.Value + (plr.leaderstats.Oil.Value * multiplier)
plr.leaderstats.Oil.Value = 0
wait(1)
db = false
end
end
end)
and here is the script of my leaderstats:~~~~~~~~~~~~~~~~~
local DSS = game:GetService("DataStoreService")
local localDataStore = DSS:GetDataStore("localDataStore")
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new ("Folder",player)
leaderstats.Name = "leaderstats"
local Money = Instance.new("IntValue", leaderstats)
Money.Name = "Money"
local CompanyValue = Instance.new("IntValue", leaderstats)
CompanyValue.Name = "CompanyValue"
local Oil = Instance.new("IntValue", leaderstats)
Oil.Name = "Oil"
I don't know what's wrong please help me! Thanks!

1 comment
sorry for the wierd boxes idk what I've done wrong!