ReplicatedStorage.BuyEvent.OnServerEvent:Connect(function(A,W)local X=ToolSettings[W]if not X then return end local Z=A.MembershipType==Premium and X.PremiumPrice or X.Price local p=A.leaderstats.Cash local u=A:WaitForChild("\066\097\099\107\112\097\099\107")if p.Value>=Z then p.Value-=Z;(X.Tool:Clone()).Parent=u end end)


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)
