Ata, Utiliza a linha textPistol = guiGetText(EditPistola) dentro da if (tonumber(guiGetText(EditPistola))) then não esqueça de adicionar um local atrás da linha
 
function purchaseWeapons(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedWorld)
	if DirectX == true then
		local playerMoney = getPlayerMoney(localPlayer)
		if state == "down" then
			if cursorPosition(screenW * 0.4609, screenH * 0.5500, screenW * 0.0117, screenH * 0.0417) then --//PISTOLA
				if (tonumber(guiGetText(EditPistola))) then
					local textPistol = guiGetText(EditPistola)
					local weapon, ammo, price, weaponName = 22, tonumber(textPistol), 10000 + 150 * tonumber(textPistol), "Colt 45" -- Linha com erro
					triggerServerEvent("DeltaSCR:Buy", localPlayer, weapon, ammo, price, weaponName)
					DeltaAbrir()
				else
					outputChatBox("ERRO: #FFFFFFPor favor, preencha o campo com um número válido", 200, 50, 0, true)
				end
			elseif cursorPosition(screenW * 0.3438, screenH * 0.6667, screenW * 0.1172, screenH * 0.0417) then --//AK-47
				weapon, ammo, price, weaponName = 20, 280, 18000, "AK-47"
				triggerServerEvent("DeltaSCR:Buy", localPlayer, weapon, ammo, price, weaponName)
				DeltaAbrir()
			elseif cursorPosition(screenW * 0.3438, screenH * 0.6083, screenW * 0.1172, screenH * 0.0417) then --//SHOTGUN
				weapon, ammo, price, weaponName = 25, 120, 25000, "Shotgun"
				triggerServerEvent("DeltaSCR:Buy", localPlayer, weapon, ammo, price, weaponName)
				DeltaAbrir()
			end
		end
	end
end
addEventHandler ("onClientClick", root, purchaseWeapons)