--local roPrompts = require(game.ReplicatedStorage.roPrompts)


ReplicatedStorage.BuyEvent.OnServerEvent:Connect(function(player, toolname)

	--local prompt = roPrompts.New({
	--	Type = roPrompts.PromptType.Confirm,
	--	Title = 'Confirm Purchase',
	--	Description = 'Are you sure you would like to buy this tool?',
	--	PrimaryButton = 'Confirm',
	--	SecondaryButton = 'Cancel'
	--})

	--roPrompts:PromptPlayer(player, prompt)

	--if roPrompts:PromptPlayer(player, prompt) then

		local Setting = ToolSettings[toolname]

		if not Setting then return end

		local Price = (player.MembershipType == Premium and Setting.PremiumPrice) or Setting.Price

		local Cash = player.leaderstats.Cash

		local Backpack = player:WaitForChild("Backpack")

		if Cash.Value >= Price then
			Cash.Value -= Price
			Setting.Tool:Clone().Parent = Backpack
		end

	--end

end)
