This is my script
local player = game.Players.LocalPlayer local coins = player:WaitForChild("leaderstats"):WaitForChild("Berrys") local gold = player:WaitForChild("leaderstats"):WaitForChild("Gold") local enabled = false script.Parent.MouseButton1Click:connect(function() enabled = false if coins.Value < 100 then return end enabled = true coins.Value = coins.Value - 50 gold.Value = gold.Value + 10 end)
I want to know if I can change the value of <100 to any number but the value of the sale is equal to that of gold
Ex: If I have 1 Berrys (Money), then I win 1 Gold (Money) if I have 4 Berrys i win for 4 Gold and so on
Just like simulator games, you sell what you took for money****
Depending on how you set your berries up, if each berry is an item in the player inventory/backpack you could try
for i, item in pairs(player.Backpack:GetChildren()) do -- The parameter is wherever the berries are stored if item.Name == 'Berry' then --do this for every berry end end