Adding Gems to my Shop

Hello everyone I am trying to add it so that only specific swords need gems to buy them and a few gems not just one. This is my script before adding gems:

local RS = game:GetService("ReplicatedStorage") --I defined the replicated storage here

RS.BuyItem.OnServerEvent:Connect(function(player, price, toolName, button) --When the event fire, do the following commands:
	if(not player.Backpack:FindFirstChild(toolName) and not player.Character:FindFirstChild(toolName))  then --If the player does not have the tool
		if(player.leaderstats.Gold.Value >= price) then --And if he has more or the same cash than the price
			player.leaderstats.Gold.Value = player.leaderstats.Gold.Value - price --Decrease his cash amount by the price
			local item = RS.ShopItems[toolName]:Clone() --Clone the tool
			item.Parent = player.Backpack --Put it in the player's backpack
			button.BackgroundColor3 = Color3.fromRGB(255, 0, 0) --Set the button's color to red
			button.Text = "Bought!" --Set the button's text to "Bought!"
			wait(1) --Wait one second
			button.BackgroundColor3 = Color3.fromRGB(85, 170, 0) --Set the color back to green
			button.Text = "Buy" --Change the text to "Buy"
		end
	end
end)

Hey inquisitor! Sorry I’m on mobile right now so I can’t type exact code but I can give you an idea. In each tool, insert a string value named “CurencyName” and set the value to either Coins or Gems.

Then on the local script check the tool:FindFistChild(“CurrencyName”).Value, and fire the server also with that value.

Then on the server side, instead of decreasing the coins do this: player.leaderstats:FindFirstChild(currencyname).Value -= price

Thanks! I will try that but I have other scripts that fires the server and the regular shop works I just want to add something so that some tools need specific gems which I do not know how to do.

What do you mean by specific gems? Like different types of gems on top of the coins?

Yes different types of gems that would be needed for different swords so some swords would need gems and coins to buy others need only coins.